Fix bug causing all errors to be treated as unexpected

This commit is contained in:
Matthew Oslan
2019-09-06 15:36:58 -04:00
parent 3f11dbc1cc
commit 6e0f9a73b8

View File

@@ -60,6 +60,8 @@ export class CodedError extends Error {
public constructor( errCode: ErrorCode, message?: string ) { public constructor( errCode: ErrorCode, message?: string ) {
super( message ); super( message );
// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
Object.setPrototypeOf( this, CodedError.prototype );
this.errCode = errCode; this.errCode = errCode;
} }
} }