Skip to content

Instantly share code, notes, and snippets.

@sbrl
Last active February 13, 2020 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbrl/d3b96d6204dd070daf340be4b2145bb1 to your computer and use it in GitHub Desktop.
Save sbrl/d3b96d6204dd070daf340be4b2145bb1 to your computer and use it in GitHub Desktop.
[ErrorWrapper.mjs] Error wrapper class - wrap errors like C♯! #error-handling
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