ICouch v0.6.2 ICouch.RequestError exception View Source

Wraps REST and connection errors from CouchDB.

Link to this section Summary

Functions

Translates a well-known error to an message to be used in the exception.

Parses a status code from ibrowse to a well-known error.

Link to this section Types

Link to this type

well_known_error()

View Source
well_known_error() ::
  :not_modified
  | :bad_request
  | :unauthorized
  | :forbidden
  | :not_found
  | :method_not_allowed
  | :conflict
  | :precondition_failed
  | :unsupported_media_type
  | :expectation_failed
  | :internal_server_error
  | {:status_code, integer()}
  | {:conn_failed, term()}
  | :invalid_response

Link to this section Functions

Link to this function

message_for_reason(arg1)

View Source
message_for_reason(error :: well_known_error() | term()) :: String.t()

Translates a well-known error to an message to be used in the exception.

Link to this function

parse_status_code(status)

View Source
parse_status_code(list() | :timeout) :: :ok | {:error, well_known_error()}

Parses a status code from ibrowse to a well-known error.

Link to this macro

req_result_or_raise!(call)

View Source (macro)