HttpApiError unstable
Built-in error schemas for common HTTP API failure responses.
This module provides reusable Schema.Error values for common HTTP
status codes, plus HttpApiSchemaError for request decoding failures raised
by the HTTP API runtime. The status errors can be used in endpoint or
middleware error declarations and are understood by builders, generated
clients, reflection, and OpenAPI generation.
Errors
BadRequest
unstableBuilt-in HTTP API error for a 400 Bad Request response. When used directly as
a server response, it renders as an empty response with status 400.
Signature
declare class BadRequest extends { readonly _tag: "BadRequest";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "BadRequest"; }, options?: MakeOptions]); readonly "~effect/ErrorReporter/ignore": true; static readonly singleton: BadRequest; "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}Built-in HTTP API error for a 409 Conflict response. When used directly as a
server response, it renders as an empty response with status 409.
Signature
declare class Conflict extends { readonly _tag: "Conflict";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "Conflict"; }, options?: MakeOptions]); readonly "~effect/ErrorReporter/ignore": true; "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}Built-in HTTP API error for a 403 Forbidden response. When used directly as a
server response, it renders as an empty response with status 403.
Signature
declare class Forbidden extends { readonly _tag: "Forbidden";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "Forbidden"; }, options?: MakeOptions]); readonly "~effect/ErrorReporter/ignore": true; "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}Built-in HTTP API error for a 410 Gone response. When used directly as a
server response, it renders as an empty response with status 410.
Signature
declare class Gone extends { readonly _tag: "Gone";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "Gone"; }, options?: MakeOptions]); readonly "~effect/ErrorReporter/ignore": true; "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}HttpApiSchemaError
unstableError raised when an HTTP API request or response component fails schema
decoding or encoding. Request decoding failures respond with an empty
400 Bad Request and are ignored by error reporters. Response encoding
failures respond with an empty 500 Internal Server Error and are reported.
Signature
declare class HttpApiSchemaError extends Readonly<{ readonly cause: SchemaError; readonly kind: "Params" | "Headers" | "Query" | "Body" | "Payload" | "ResponseHeaders";}> & { readonly _tag: "HttpApiSchemaError";} & Pipeable { constructor(args: { readonly cause: SchemaError; readonly kind: "Params" | "Headers" | "Query" | "Body" | "Payload" | "ResponseHeaders"; }); readonly "~effect/http-api/HttpApiError/HttpApiSchemaError": "~effect/http-api/HttpApiError/HttpApiSchemaError"; readonly message: "Params" | "Headers" | "Query" | "Body" | "Payload" | "ResponseHeaders"; readonly name: "HttpApiSchemaError"; "~effect/ErrorReporter/ignore": boolean; "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>; static is(u: unknown): u is HttpApiSchemaError; static wrap<A, R>(kind: "Params" | "Headers" | "Query" | "Body" | "Payload" | "ResponseHeaders", effect: Effect<A, SchemaError, R>): Effect<A, HttpApiSchemaError, R>;}InternalServerError
unstableBuilt-in HTTP API error for a 500 Internal Server Error response. When used
directly as a server response, it renders as an empty response with status 500.
Signature
declare class InternalServerError extends { readonly _tag: "InternalServerError";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "InternalServerError"; }, options?: MakeOptions]); "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}MethodNotAllowed
unstableBuilt-in HTTP API error for a 405 Method Not Allowed response. When used
directly as a server response, it renders as an empty response with status 405.
Signature
declare class MethodNotAllowed extends { readonly _tag: "MethodNotAllowed";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "MethodNotAllowed"; }, options?: MakeOptions]); readonly "~effect/ErrorReporter/ignore": true; "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}NotAcceptable
unstableBuilt-in HTTP API error for a 406 Not Acceptable response. When used directly
as a server response, it renders as an empty response with status 406.
Signature
declare class NotAcceptable extends { readonly _tag: "NotAcceptable";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "NotAcceptable"; }, options?: MakeOptions]); readonly "~effect/ErrorReporter/ignore": true; "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}Built-in HTTP API error for a 404 Not Found response. When used directly as a
server response, it renders as an empty response with status 404.
Signature
declare class NotFound extends { readonly _tag: "NotFound";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "NotFound"; }, options?: MakeOptions]); readonly "~effect/ErrorReporter/ignore": true; "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}NotImplemented
unstableBuilt-in HTTP API error for a 501 Not Implemented response. When used directly
as a server response, it renders as an empty response with status 501.
Signature
declare class NotImplemented extends { readonly _tag: "NotImplemented";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "NotImplemented"; }, options?: MakeOptions]); "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}RequestTimeout
unstableBuilt-in HTTP API error for a 408 Request Timeout response. When used directly
as a server response, it renders as an empty response with status 408.
Signature
declare class RequestTimeout extends { readonly _tag: "RequestTimeout";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "RequestTimeout"; }, options?: MakeOptions]); readonly "~effect/ErrorReporter/ignore": true; "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}UnprocessableEntity
unstableBuilt-in HTTP API error for a 422 Unprocessable Entity response. When used
directly as a server response, it renders as an empty response with status 422.
Signature
declare class UnprocessableEntity extends { readonly _tag: "UnprocessableEntity";} & YieldableError<this> { constructor(...args: [props?: { readonly _tag?: "UnprocessableEntity"; }, options?: MakeOptions]); readonly "~effect/ErrorReporter/ignore": true; "~effect/http/HttpServerRespondable"(): Effect<HttpServerResponse, never, never>;}Schemas
BadRequestNoContent
unstableNo-content schema variant for BadRequest, decoding an empty 400 response into
a BadRequest error value.
Signature
declare const BadRequestNoContent: asNoContent<typeof BadRequest>ConflictNoContent
unstableNo-content schema variant for Conflict, decoding an empty 409 response into a
Conflict error value.
Signature
declare const ConflictNoContent: asNoContent<typeof Conflict>ForbiddenNoContent
unstableNo-content schema variant for Forbidden, decoding an empty 403 response into a
Forbidden error value.
Signature
declare const ForbiddenNoContent: asNoContent<typeof Forbidden>GoneNoContent
unstableNo-content schema variant for Gone, decoding an empty 410 response into a
Gone error value.
Signature
declare const GoneNoContent: asNoContent<typeof Gone>InternalServerErrorNoContent
unstableNo-content schema variant for InternalServerError, decoding an empty 500
response into an InternalServerError error value.
Signature
declare const InternalServerErrorNoContent: asNoContent<typeof InternalServerError>MethodNotAllowedNoContent
unstableNo-content schema variant for MethodNotAllowed, decoding an empty 405 response
into a MethodNotAllowed error value.
Signature
declare const MethodNotAllowedNoContent: asNoContent<typeof MethodNotAllowed>NotAcceptableNoContent
unstableNo-content schema variant for NotAcceptable, decoding an empty 406 response
into a NotAcceptable error value.
Signature
declare const NotAcceptableNoContent: asNoContent<typeof NotAcceptable>NotFoundNoContent
unstableNo-content schema variant for NotFound, decoding an empty 404 response into a
NotFound error value.
Signature
declare const NotFoundNoContent: asNoContent<typeof NotFound>NotImplementedNoContent
unstableNo-content schema variant for NotImplemented, decoding an empty 501 response
into a NotImplemented error value.
Signature
declare const NotImplementedNoContent: asNoContent<typeof NotImplemented>RequestTimeoutNoContent
unstableNo-content schema variant for RequestTimeout, decoding an empty 408 response
into a RequestTimeout error value.
Signature
declare const RequestTimeoutNoContent: asNoContent<typeof RequestTimeout>UnprocessableEntityNoContent
unstableNo-content schema variant for UnprocessableEntity, decoding an empty 422
response into an UnprocessableEntity error value.
Signature
declare const UnprocessableEntityNoContent: asNoContent<typeof UnprocessableEntity>Type IDs
HttpApiSchemaErrorTypeId
unstableRuntime identifier used to mark and detect HttpApiSchemaError values.
Signature
declare const HttpApiSchemaErrorTypeId: "~effect/http-api/HttpApiError/HttpApiSchemaError"Type-level identifier used to mark HttpApiSchemaError values.
Signature
type HttpApiSchemaErrorTypeId = "~effect/http-api/HttpApiError/HttpApiSchemaError"