import type { APIErrorCode } from "../../shared/api.ts"; /** Thrown anywhere below a route; errorMiddleware turns it into a response. */ export class APIException extends Error { readonly code: APIErrorCode; readonly status: number; constructor(code: APIErrorCode, status: number, message: string) { super(message); this.code = code; this.status = status; } }