View Source ExCurl.CurlErrorCodes (ex_curl v0.1.0)

Helper functions to map curl error codes from their integer value to the string value and vice versa.

Link to this section Summary

Functions

Returns the integer code for the corresponding string error message.

Returns the string message for a coresponding integer error code.

Link to this section Functions

Returns the integer code for the corresponding string error message.

Returns -1 if the message is not a valid curl error code.

examples

Examples

iex> ExCurl.CurlErrorCodes.get_code("URL_MALFORMAT")
3

iex> ExCurl.CurlErrorCodes.get_code("DOESN'T EXIST")
-1

Returns the string message for a coresponding integer error code.

Returns "CODE_OUT_OF_RANGE if the value is not a valid curl error code.

examples

Examples

iex> ExCurl.CurlErrorCodes.get_message(3)
"URL_MALFORMAT"

iex> ExCurl.CurlErrorCodes.get_message(256)
"CODE_OUT_OF_RANGE"