Polymarket_common.ErrorSourcePolymorphic error types for composable error handling.
This module provides extensible error types using polymorphic variants, allowing different parts of the codebase to define their own error cases while maintaining composability.
HTTP-related errors.
JSON parsing errors.
Network/connection errors.
Rate limiting errors.
type http_errors = [ | `Http_error of http_error| `Parse_error of parse_error| `Network_error of network_error ]Core HTTP client errors.
Rate limiting errors.
All API errors (HTTP + rate limiting).
val http_error :
status:int ->
body:string ->
message:string ->
[> `Http_error of http_error ]Construct an HTTP error.
Construct a parse error.
Construct a network error.
val rate_limited :
retry_after:float ->
route_key:string ->
[> `Rate_limited of rate_limit_error ]Construct a rate limit error.
Convert HTTP errors to string.
Convert API errors (including rate limiting) to string.
Parse an HTTP error response body to extract error message.
Map over the error type of a result.
Lift an http_errors result to an api_errors result.