mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 09:39:23 +00:00
Merge pull request #7198 from crookedneighbor/capture_stack_trace
fix: Only apply captureStackTrace if it exists on the error object
This commit is contained in:
commit
afc51cbdc4
1 changed files with 4 additions and 1 deletions
|
|
@ -5,8 +5,11 @@ import extendableBuiltin from './extendableBuiltin';
|
|||
export class CustomError extends extendableBuiltin(Error) {
|
||||
constructor () {
|
||||
super();
|
||||
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We specify an httpCode for all errors so that they can be used in the API too
|
||||
|
|
|
|||
Loading…
Reference in a new issue