package reddit_api_kernel
Module Endpoint.ErrorSource
An Error.t represents a "normal" error when making an API request.
"Normal" includes transient errors such as a loss of connectivity or HTTP responses representing temporary server issues. It also includes HTTP responses indicating an illegal operation, such as permission errors.
It does not include programming errors within Reddit_api_kernel; if we can't parse a response, we raise instead of returning an error value.
Source
type t = | Cohttp_raised of Core_kernel.Exn.t| Json_parsing_error of {error : Core_kernel.Error.t;response : Cohttp.Response.t;body_string : string;
}| Http_error of {response : Cohttp.Response.t;body : Cohttp.Body.t;
}(*An
Http_errorrepresents an HTTP response with an error status for which we have not parsed details from the JSON body.
*)400 Bad Requestresponses come with parseable JSON details, so they are included underJson_response_errorsinstead.| Json_response_errors of Json_response_error.t list