Skip to content

Commit

Permalink
Fix bug causing all errors to be treated as unexpected
Browse files Browse the repository at this point in the history
  • Loading branch information
Derpthemeus committed Sep 6, 2019
1 parent 3f11dbc commit 6e0f9a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions errors.ts
Expand Up @@ -60,6 +60,8 @@ export class CodedError extends Error {

public constructor( errCode: ErrorCode, message?: string ) {
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;
}
}
Expand Down

0 comments on commit 6e0f9a7

Please sign in to comment.