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,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