18 lines
406 B
TypeScript
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 },
|
|
})
|
|
}
|