@r/api-client
Version:
node and browser reddit api library
16 lines (14 loc) • 366 B
JavaScript
export default class ErrorClass {
constructor (message) {
if (Error.hasOwnProperty('captureStackTrace')) {
Error.captureStackTrace(this, this.constructor);
} else {
Object.defineProperty(this, 'stack', {
value: (new Error()).stack,
});
Object.defineProperty(this, 'message', {
value: message,
});
}
}
}