mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-11-03 02:57:13 -05:00
15 lines
350 B
TypeScript
15 lines
350 B
TypeScript
import { t } from "elysia";
|
|
|
|
export const KError = t.Object({
|
|
status: t.Integer(),
|
|
message: t.String(),
|
|
details: t.Optional(t.Any()),
|
|
});
|
|
export type KError = typeof KError.static;
|
|
|
|
export class KErrorT extends Error {
|
|
constructor(message: string, details?: any) {
|
|
super(JSON.stringify({ code: "KError", status: 422, message, details }));
|
|
}
|
|
}
|