class MyCustomError extends Schema.TaggedError<>()("MyCustomError", {
message: Schema.String,
type: Schema.String
}) {}
....
export const customEndpoint = HttpApiEndpoint.post(
"customEndpoint",
"/test",
)
.setPayload(xxx)
.addSuccess(xxx)
.addError(MyCustomError); // Adding the error here
class MyCustomError extends Schema.TaggedError<>()("MyCustomError", {
message: Schema.String,
type: Schema.String
}) {}
....
export const customEndpoint = HttpApiEndpoint.post(
"customEndpoint",
"/test",
)
.setPayload(xxx)
.addSuccess(xxx)
.addError(MyCustomError); // Adding the error here