Files
nodes/store/src/routes/node/errors.ts
Max Richter 15ff1cc52d
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m4s
feat: some shit
2024-12-20 15:24:54 +01:00

34 lines
742 B
TypeScript

import { StatusCode } from "hono";
export class CustomError extends Error {
constructor(public status: StatusCode, message: string) {
super(message);
this.name = this.constructor.name;
Error.captureStackTrace(this, this.constructor);
}
}
export class NodeNotFoundError extends CustomError {
constructor() {
super(404, "Node not found");
}
}
export class InvalidNodeDefinitionError extends CustomError {
constructor() {
super(400, "Invalid node definition");
}
}
export class WorkerTimeoutError extends CustomError {
constructor() {
super(500, "Worker timed out");
}
}
export class UnknownWorkerResponseError extends CustomError {
constructor() {
super(500, "Unknown worker response");
}
}