From eba51066d9d9732a485674833b6dd561f477c647 Mon Sep 17 00:00:00 2001 From: blagoev Date: Tue, 12 Sep 2017 23:02:14 +0300 Subject: [PATCH] fix AuthError object --- lib/errors.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/errors.js b/lib/errors.js index 82767ca2..f2c55fe2 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -19,7 +19,12 @@ 'use strict'; function AuthError(problem) { - Error.call(this, problem.title); + const error = Error.call(this, problem.title); + + this.name = 'AuthError'; + this.message = error.message; + this.stack = error.stack; + Object.assign(this, problem); }