glitchedhttps
Macros
glitchedhttps_exitcodes.h File Reference

Exit codes returned by the various glitchedhttps functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GLITCHEDHTTPS_SUCCESS   0
 
#define GLITCHEDHTTPS_UNINITIALIZED   10
 
#define GLITCHEDHTTPS_OUT_OF_MEM   100
 
#define GLITCHEDHTTPS_NULL_ARG   200
 
#define GLITCHEDHTTPS_INVALID_ARG   300
 
#define GLITCHEDHTTPS_INVALID_PORT_NUMBER   400
 
#define GLITCHEDHTTPS_INVALID_HTTP_METHOD_NAME   500
 
#define GLITCHEDHTTPS_CHILLBUFF_ERROR   600
 
#define GLITCHEDHTTPS_RESPONSE_PARSE_ERROR   700
 
#define GLITCHEDHTTPS_EXTERNAL_ERROR   800
 
#define GLITCHEDHTTPS_OVERFLOW   900
 
#define GLITCHEDHTTPS_CONNECTION_TO_SERVER_FAILED   1000
 
#define GLITCHEDHTTPS_HTTP_REQUEST_TRANSMISSION_FAILED   1100
 
#define GLITCHEDHTTPS_HTTP_GETADDRINFO_FAILED   1200
 
#define GLITCHEDHTTPS_EMPTY_RESPONSE   1300
 

Detailed Description

Exit codes returned by the various glitchedhttps functions.

Macro Definition Documentation

◆ GLITCHEDHTTPS_CHILLBUFF_ERROR

#define GLITCHEDHTTPS_CHILLBUFF_ERROR   600

When the error is not due to glitchedhttps but the underlying chillbuff instance (e.g. if the chillbuff init function fails for some reason (e.g. out of memory/failure to reallocate) and the http request function can't proceed without a stringbuilder).

◆ GLITCHEDHTTPS_CONNECTION_TO_SERVER_FAILED

#define GLITCHEDHTTPS_CONNECTION_TO_SERVER_FAILED   1000

Returned by a plain HTTP request if connection to the specified server couldn't be established.

◆ GLITCHEDHTTPS_EMPTY_RESPONSE

#define GLITCHEDHTTPS_EMPTY_RESPONSE   1300

If the returned HTTP response string is empty.

◆ GLITCHEDHTTPS_EXTERNAL_ERROR

#define GLITCHEDHTTPS_EXTERNAL_ERROR   800

When something fails that has nothing to do with glitchedhttps, like for example if something failed inside an MbedTLS function; in that case, check the logs (if you provided an error callback via the glitchedhttps_set_error_callback() function).

◆ GLITCHEDHTTPS_HTTP_GETADDRINFO_FAILED

#define GLITCHEDHTTPS_HTTP_GETADDRINFO_FAILED   1200

Returned if the plain http:// request failed due to a getaddrinfo() failure.

◆ GLITCHEDHTTPS_HTTP_REQUEST_TRANSMISSION_FAILED

#define GLITCHEDHTTPS_HTTP_REQUEST_TRANSMISSION_FAILED   1100

Returned by a plain HTTP request if connection to the specified server was successful but the request couldn't be transmitted to the server.

◆ GLITCHEDHTTPS_INVALID_ARG

#define GLITCHEDHTTPS_INVALID_ARG   300

This error code is returned by a glitchedhttps function if you passed an invalid parameter into it.

◆ GLITCHEDHTTPS_INVALID_HTTP_METHOD_NAME

#define GLITCHEDHTTPS_INVALID_HTTP_METHOD_NAME   500

Returned if the given HTTP method is not one of the allowed ones (e.g. GET, POST, etc...).

◆ GLITCHEDHTTPS_INVALID_PORT_NUMBER

#define GLITCHEDHTTPS_INVALID_PORT_NUMBER   400

Returned when the request URL has an invalid port number.

◆ GLITCHEDHTTPS_NULL_ARG

#define GLITCHEDHTTPS_NULL_ARG   200

Error code returned by a glitchedhttps function if you passed a NULL argument that shouldn't have been NULL.

◆ GLITCHEDHTTPS_OUT_OF_MEM

#define GLITCHEDHTTPS_OUT_OF_MEM   100

If you get this, it means you're out of memory!

◆ GLITCHEDHTTPS_OVERFLOW

#define GLITCHEDHTTPS_OVERFLOW   900

Not good...

◆ GLITCHEDHTTPS_RESPONSE_PARSE_ERROR

#define GLITCHEDHTTPS_RESPONSE_PARSE_ERROR   700

Returned if the HTTP response string couldn't be parsed.

◆ GLITCHEDHTTPS_SUCCESS

#define GLITCHEDHTTPS_SUCCESS   0

Returned from a glitchedhttps function when everything went as expected.

◆ GLITCHEDHTTPS_UNINITIALIZED

#define GLITCHEDHTTPS_UNINITIALIZED   10

Returned when trying to submit a request without having initialized GlitchedHTTPS with the glitchedhttps_init() function first.

Never forget to glitchedhttps_free() once you're done using GlitchedHTTPS to release the resources and prevent memory leaks!