Skip to content

Commit

Permalink
make GroutError status a getter
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Dec 18, 2024
1 parent cecd991 commit e278c21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/errors/groutError.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { ErrorType, ErrorTypeStatuses } from "./errorType";

export class GroutError extends Error {
status: number;
errorType: ErrorType;

constructor(message: string, errorType: ErrorType) {
super(message);

this.name = "GroutError";
this.status = ErrorTypeStatuses[errorType];
this.errorType = errorType;
}

get status() {
return ErrorTypeStatuses[this.errorType];
}
}

0 comments on commit e278c21

Please sign in to comment.