diff --git a/packages/api/src/lib/error.ts b/packages/api/src/lib/error.ts index 39d7317a..bbbc0fee 100644 --- a/packages/api/src/lib/error.ts +++ b/packages/api/src/lib/error.ts @@ -2,6 +2,11 @@ import type { Error as ErrorResponse } from "@biseo/interface/helpers"; import logger from "@biseo/api/utils/logger"; export class BiseoError extends Error { + constructor(message: string) { + super(message); + Object.setPrototypeOf(this, BiseoError.prototype); + } + serialize() { return { ok: false, message: this.message } as const; }