Last active
February 13, 2020 16:43
-
-
Save sbrl/d3b96d6204dd070daf340be4b2145bb1 to your computer and use it in GitHub Desktop.
[ErrorWrapper.mjs] Error wrapper class - wrap errors like C♯! #error-handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ErrorWrapper extends Error { | |
constructor(message, inner_exception) { | |
super(message); | |
this.inner_exception = inner_exception; | |
} | |
toString() { | |
return `${super.toString()}\n***Inner Exception ***\n${this.inner_exception}`; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment