Type session not-found errors (#25818)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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 },
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user