mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
fix: Only apply captureStackTrace if it exists on the error object
This commit is contained in:
@@ -5,7 +5,10 @@ import extendableBuiltin from './extendableBuiltin';
|
|||||||
export class CustomError extends extendableBuiltin(Error) {
|
export class CustomError extends extendableBuiltin(Error) {
|
||||||
constructor () {
|
constructor () {
|
||||||
super();
|
super();
|
||||||
Error.captureStackTrace(this, this.constructor);
|
|
||||||
|
if (Error.captureStackTrace) {
|
||||||
|
Error.captureStackTrace(this, this.constructor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user