libCATS
Loading...
Searching...
No Matches
Macros | Enumerations | Functions | Variables
error.h File Reference

Error handling. More...

Go to the source code of this file.

Macros

#define CATS_FAIL   0
 
#define CATS_SUCCESS   1
 
#define throw(err)   do { cats_throw_err(err, #err); return CATS_FAIL; } while(0)
 
#define throw_msg(err, msg)   do { cats_throw_err(err, #err " " msg); return CATS_FAIL; } while(0)
 

Enumerations

enum  cats_error_t {
  MALLOC_FAIL , UNSUPPORTED_WHISKER , DECODE_FAIL , PACKET_TOO_BIG ,
  INVALID_OR_NO_CALLSIGN , INVALID_OR_NO_COMMENT , LDPC_DECODE_FAIL , INVALID_CRC ,
  WHISKER_NOT_FOUND , EMPTY_PACKET , MAX_WHISKERS_OF_TYPE_EXCEEDED
}
 Error codes for libCATS. More...
 

Functions

void cats_throw_err (cats_error_t error, const char *msg)
 Do NOT use this function directly, use throw() instead.
 

Variables

cats_error_t cats_error
 The most recent error thrown by libCATS.
 
char cats_error_str [255]
 Error string for the most recent error thrown by libCATS.
 

Detailed Description

Error handling.

Enumeration Type Documentation

◆ cats_error_t

Error codes for libCATS.

Note
These are not to be used directly as return values; use throw() instead. Errors can be retrieved from cats_error.