node: less error spam in logs.

This commit is contained in:
Christopher Jeffrey 2016-11-27 23:54:18 -08:00
parent c7b7678f8a
commit 6520cf32e0
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -166,14 +166,20 @@ Node.prototype._error = function _error(err) {
if (!err)
return;
switch (err.reason) {
case 'insufficient priority':
case 'non-final':
this.logger.spam(err.message);
break;
default:
this.logger.error(err);
break;
if (err.type === 'VerifyError') {
switch (err.reason) {
case 'insufficient priority':
case 'non-final':
this.logger.spam(err.message);
break;
default:
this.logger.error(err.message);
break;
}
} else if (typeof err.code === 'string' && err.code[0] === 'E') {
this.logger.error(err.message);
} else {
this.logger.error(err);
}
this.emit('error', err);