cloudaxe-opencode/packages/opencode/src/server/routes/instance/httpapi/errors.ts
2026-05-05 21:33:47 -04:00

18 lines
406 B
TypeScript

import { Schema } from "effect"
export class ApiNotFoundError extends Schema.ErrorClass<ApiNotFoundError>("NotFoundError")(
{
name: Schema.Literal("NotFoundError"),
data: Schema.Struct({
message: Schema.String,
}),
},
{ httpApiStatus: 404 },
) {}
export function notFound(message: string) {
return new ApiNotFoundError({
name: "NotFoundError",
data: { message },
})
}