mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-26 20:48:27 +02:00
Add in reason if available, to error message
This commit is contained in:
parent
16c8fd0afc
commit
b1cea5edd7
1 changed files with 4 additions and 0 deletions
|
@ -11,6 +11,10 @@ class EnigError extends Error {
|
||||||
this.reason = reason;
|
this.reason = reason;
|
||||||
this.reasonCode = reasonCode;
|
this.reasonCode = reasonCode;
|
||||||
|
|
||||||
|
if(this.reason) {
|
||||||
|
this.message += `: ${this.reason}`;
|
||||||
|
}
|
||||||
|
|
||||||
if(typeof Error.captureStackTrace === 'function') {
|
if(typeof Error.captureStackTrace === 'function') {
|
||||||
Error.captureStackTrace(this, this.constructor);
|
Error.captureStackTrace(this, this.constructor);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue