Skip to content

Instantly share code, notes, and snippets.

@sbrl
Last active Feb 13, 2020
Embed
What would you like to do?
[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