Skip to content

basalt / http/src / toErrorResponse

Function: toErrorResponse() ​

> toErrorResponse(error, options?): ErrorResponse

Defined in: http/src/pipeline.ts:235

Maps a thrown error to a standardized HTTP response — shared by all adapters so error shapes are identical regardless of framework.

Only the public channel is ever read: an error's internalDetails (see HttpErrorOptions) is for the error reporter and never reaches the body.

Parameters ​

error ​

unknown

options? ​

ErrorResponseOptions = {}

Returns ​

ErrorResponse

Released under the MIT License.