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:
Blade Barringer 2016-05-12 19:25:44 -05:00
commit afc51cbdc4

View file

@ -5,7 +5,10 @@ import extendableBuiltin from './extendableBuiltin';
export class CustomError extends extendableBuiltin(Error) {
constructor () {
super();
Error.captureStackTrace(this, this.constructor);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
}
}