MCPcopy Create free account
hub / github.com/Zoot01/sentrify-dashboard / APIError

Class APIError

apps/api/src/utils/errorHandler.ts:4–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import { ReasonPhrases, StatusCodes } from "http-status-codes";
3
4export class APIError extends Error {
5 status: StatusCodes;
6
7 constructor(status: StatusCodes, message: ReasonPhrases | string) {
8 super(message);
9
10 Object.setPrototypeOf(this, new.target.prototype);
11 this.name = Error.name;
12 this.status = status;
13 Error.captureStackTrace(this);
14 }
15}
16
17export const errorResponder = (
18 error: APIError,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected