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