errorToResponse
errorToResponse(
error,requestId?):Response
Defined in: src/core/errors.ts:69
Build a JSON Response from a GatewayError.
Merges any custom headers from the error (e.g. Retry-After) into the
response. Includes the request ID when available for tracing.
Parameters
Section titled “Parameters”The gateway error to convert.
requestId?
Section titled “requestId?”string
Optional request ID to include in the response body.
Returns
Section titled “Returns”Response
A Response with JSON body and appropriate status code.