Type Alias: ValifetchErrorOptions
ValifetchErrorOptions =
object
Defined in: src/errors/ValifetchError.ts:19
Options for creating a ValifetchError
Properties
cause?
optionalcause?:unknown
Defined in: src/errors/ValifetchError.ts:35
Original error cause. Typed as unknown to match the standard Error.cause, so any thrown value (not just an Error) can be passed through without wrapping.
code
code:
ErrorCode
Defined in: src/errors/ValifetchError.ts:23
Error code for pattern matching
message
message:
string
Defined in: src/errors/ValifetchError.ts:21
Error message
request?
optionalrequest?:Request
Defined in: src/errors/ValifetchError.ts:25
HTTP request that caused the error
response?
optionalresponse?:Response
Defined in: src/errors/ValifetchError.ts:27
HTTP response (if received)
responseBody?
optionalresponseBody?:unknown
Defined in: src/errors/ValifetchError.ts:42
Parsed response body on HTTP_ERROR (JSON-parsed object/array, or plain text when the body is not valid JSON) and raw text on PARSE_ERROR (the response body that failed to parse as JSON). undefined when the body could not be read at all.
validation?
optionalvalidation?:ValidationErrorInfo
Defined in: src/errors/ValifetchError.ts:29
Validation error details (if validation failed)