Tidy up unexpected error handling

This commit is contained in:
Matthew Oslan
2019-09-02 12:11:27 -04:00
parent 1a1ecafcb0
commit 3f11dbc1cc
2 changed files with 10 additions and 21 deletions

View File

@@ -55,11 +55,11 @@ export enum ErrorCode {
}
/** An error with a numeric code that can be used to identify the type of error. */
export class CodedError {
export class CodedError extends Error {
public readonly errCode: ErrorCode;
public readonly message: string;
public constructor( errCode: ErrorCode ) {
public constructor( errCode: ErrorCode, message?: string ) {
super( message );
this.errCode = errCode;
}
}