From b1cea5edd72868771e30aed37b729863501022af Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sat, 20 Jan 2018 15:16:10 -0700 Subject: [PATCH] Add in reason if available, to error message --- core/enig_error.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/enig_error.js b/core/enig_error.js index b0dd2335..c6eb8097 100644 --- a/core/enig_error.js +++ b/core/enig_error.js @@ -11,6 +11,10 @@ class EnigError extends Error { this.reason = reason; this.reasonCode = reasonCode; + if(this.reason) { + this.message += `: ${this.reason}`; + } + if(typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor); } else {