Concord - C Discord API library
A Discord API wrapper library written in C
Core error codes

These codes are used by the core library and should be used by all modules . More...

Collaboration diagram for Core error codes:

Macros

#define CCORD_INTERNAL_ERROR   -200
 
#define CCORD_BAD_ENCODE   -101
 
#define CCORD_BAD_DECODE   -100
 
#define CCORD_OUT_OF_MEMORY   -60
 
#define CCORD_ERRNO   -50
 
#define CCORD_CURL_WEBSOCKETS_MISSING   -14
 
#define CCORD_CURL_OUTDATED_VERSION   -13
 
#define CCORD_MALFORMED_PAYLOAD   -12
 
#define CCORD_FULL_WORKER   -11
 
#define CCORD_RESOURCE_UNAVAILABLE   -10
 
#define CCORD_RESOURCE_OWNERSHIP   -9
 
#define CCORD_GLOBAL_INIT   -8
 
#define CCORD_CURLM_INTERNAL   -7
 
#define CCORD_CURLE_INTERNAL   -6
 
#define CCORD_BAD_JSON   -5
 
#define CCORD_BAD_PARAMETER   -4
 
#define CCORD_UNUSUAL_HTTP_CODE   -3
 
#define CCORD_CURL_NO_RESPONSE   -2
 
#define CCORD_HTTP_CODE   -1
 
#define CCORD_OK   0
 

Functions

const char * ccord_code_as_string (CCORDcode code)
 
const char * ccord_strerror (CCORDcode code)
 

Detailed Description

These codes are used by the core library and should be used by all modules .

Macro Definition Documentation

◆ CCORD_INTERNAL_ERROR

#define CCORD_INTERNAL_ERROR   -200

most likely a bug in the library, please report it

◆ CCORD_BAD_ENCODE

#define CCORD_BAD_ENCODE   -101

couldn't encode format

◆ CCORD_BAD_DECODE

#define CCORD_BAD_DECODE   -100

couldn't decode format

◆ CCORD_OUT_OF_MEMORY

#define CCORD_OUT_OF_MEMORY   -60

out of memory, something really bad happened!

◆ CCORD_ERRNO

#define CCORD_ERRNO   -50

check strerror() for more information

◆ CCORD_CURL_WEBSOCKETS_MISSING

#define CCORD_CURL_WEBSOCKETS_MISSING   -14

curl has been compiled without the –enable-websockets flag

◆ CCORD_CURL_OUTDATED_VERSION

#define CCORD_CURL_OUTDATED_VERSION   -13

curl need to be updated to 8.7.1 or greater

◆ CCORD_MALFORMED_PAYLOAD

#define CCORD_MALFORMED_PAYLOAD   -12

failure when creating request's payload

◆ CCORD_FULL_WORKER

#define CCORD_FULL_WORKER   -11

couldn't enqueue worker thread (queue is full)

◆ CCORD_RESOURCE_UNAVAILABLE

#define CCORD_RESOURCE_UNAVAILABLE   -10

couldn't perform action because resource is unavailable

◆ CCORD_RESOURCE_OWNERSHIP

#define CCORD_RESOURCE_OWNERSHIP   -9

couldn't cleanup resource automatically due to being claimed

◆ CCORD_GLOBAL_INIT

#define CCORD_GLOBAL_INIT   -8

attempt to initialize globals more than once

◆ CCORD_CURLM_INTERNAL

#define CCORD_CURLM_INTERNAL   -7

curl's multi handle internal error

◆ CCORD_CURLE_INTERNAL

#define CCORD_CURLE_INTERNAL   -6

curl's easy handle internal error

◆ CCORD_BAD_JSON

#define CCORD_BAD_JSON   -5

internal failure when encoding or decoding JSON

◆ CCORD_BAD_PARAMETER

#define CCORD_BAD_PARAMETER   -4

bad value for parameter

◆ CCORD_UNUSUAL_HTTP_CODE

#define CCORD_UNUSUAL_HTTP_CODE   -3

received a non-standard http code

◆ CCORD_CURL_NO_RESPONSE

#define CCORD_CURL_NO_RESPONSE   -2

no response came through from curl

◆ CCORD_HTTP_CODE

#define CCORD_HTTP_CODE   -1

request wasn't succesful

◆ CCORD_OK

#define CCORD_OK   0

action was a success

Examples
fetch-messages.c, manual-dm.c, and slash-commands2.c.

Function Documentation

◆ ccord_code_as_string()

const char * ccord_code_as_string ( CCORDcode  code)

◆ ccord_strerror()

const char * ccord_strerror ( CCORDcode  code)