diff --git a/packages/server/js/errors.js b/packages/server/js/errors.js index 761dc65..5761843 100644 --- a/packages/server/js/errors.js +++ b/packages/server/js/errors.js @@ -1,3 +1,5 @@ +const util = require('util') + module.exports = class ServerError extends Error { constructor (options = {}) { super() @@ -21,4 +23,8 @@ module.exports = class ServerError extends Error { return `ServerError: ${this.code}: ${this.message}` } } + + [util.inspect.custom] () { + return `[${this.code}] ${this.message || (this.originError && this.originError.message) || 'Unknown Error'}` + } }