feat: some shit
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m4s
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m4s
This commit is contained in:
33
store/src/routes/node/errors.ts
Normal file
33
store/src/routes/node/errors.ts
Normal file
@ -0,0 +1,33 @@
|
||||
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");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user