Fix bug causing all errors to be treated as unexpected
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user