It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
JSR Score
29%
Published
6 months ago (0.0.1)
type StatusErrorObject = { error?: string [key: string]: any } export class StatusError extends Error { status: number; [key: string]: any constructor(status = 500, body?: StatusErrorObject | string) { super(typeof body === 'object' ? body.error : body) typeof body === 'object' && Object.assign(this, body) this.status = status } }