package polymarket
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Module Polymarket_common.ErrorSource
Polymorphic 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.
Base Error Types
HTTP-related errors.
JSON parsing errors.
Network/connection errors.
Rate limiting errors.
Polymorphic Error Variants
Source
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).
Error Constructors
Source
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.
Source
val rate_limited :
retry_after:float ->
route_key:string ->
[> `Rate_limited of rate_limit_error ]Construct a rate limit error.
Error Formatting
Convert HTTP errors to string.
Convert API errors (including rate limiting) to string.
Pretty Printers
Error Parsing Helpers
Parse an HTTP error response body to extract error message.
Result Helpers
Map over the error type of a result.
Lift an http_errors result to an api_errors result.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page