atobase  3.2.0
ATOMAS atobase
General Error

Query ato_Error objects. More...

Typedefs

typedef struct _ato_Err ato_Err
 The Error type.
 

Enumerations

enum  ato_eErrSeverity { ATO_ESEVERITY_FATAL , ATO_ESEVERITY_ERR , ATO_ESEVERITY_WARN }
 The severity of the error. More...
 

Functions

ATO_EXPORT bool ato_err_iserror (ato_Err *err)
 Convenience method - FALSE if ATO_ERR_OK. More...
 
ATO_EXPORT int ato_err_code (ato_Err *err)
 Get the error code. More...
 
ATO_EXPORT const char * ato_err_codename (ato_Err *err)
 Get the error code name as as string. More...
 
ATO_EXPORT const char * ato_err_codemsg (ato_Err *err)
 Get the stock message defined for the given error code. More...
 
ATO_EXPORT ato_eErrSeverity ato_err_severity (ato_Err *err)
 Get the severity. More...
 
ATO_EXPORT const char * ato_err_library (ato_Err *err)
 Get the library (string) where the error was created. More...
 
ATO_EXPORT const char * ato_err_module (ato_Err *err)
 Get the module (file) where the error was created. More...
 
ATO_EXPORT const char * ato_err_function (ato_Err *err)
 Get the function where the error was created. More...
 
ATO_EXPORT int ato_err_line (ato_Err *err)
 Get the line where the error was created. More...
 
ATO_EXPORT const char * ato_err_msg (ato_Err *err)
 Get the message attached to the error. More...
 
ATO_EXPORT ato_Errato_err_inner (ato_Err *err)
 Get the nested/inner error object if any. More...
 
ATO_EXPORT void * ato_err_custom (ato_Err *err)
 Get the custom object if any. More...
 

Detailed Description

Query ato_Error objects.

Error objects are created and attached to the current Context object, if an error occurs.

Errors can be nested - see ato_err_inner().

For a general description see Overview.

Enumeration Type Documentation

◆ ato_eErrSeverity

The severity of the error.

Enumerator
ATO_ESEVERITY_FATAL 

the application may halt immediately, if not it should exit ASAP

ATO_ESEVERITY_ERR 

the application should go into recovery mode (e.g.

restoring connections)

ATO_ESEVERITY_WARN 

business or user level error such as invalid password, so try again

Function Documentation

◆ ato_err_iserror()

ATO_EXPORT bool ato_err_iserror ( ato_Err err)

Convenience method - FALSE if ATO_ERR_OK.

Parameters
errerror object
Returns
TRUE or FALSE

◆ ato_err_code()

ATO_EXPORT int ato_err_code ( ato_Err err)

Get the error code.

Parameters
errerror object
Returns
the error code

◆ ato_err_codename()

ATO_EXPORT const char* ato_err_codename ( ato_Err err)

Get the error code name as as string.

Parameters
errerror object
Returns
the error code name e.g. "ATO_ERR_OK" is the name for code 0.

◆ ato_err_codemsg()

ATO_EXPORT const char* ato_err_codemsg ( ato_Err err)

Get the stock message defined for the given error code.

Parameters
errerror object
Returns
the error code message

◆ ato_err_severity()

ATO_EXPORT ato_eErrSeverity ato_err_severity ( ato_Err err)

Get the severity.

Parameters
errerror object
Returns
the severity

◆ ato_err_library()

ATO_EXPORT const char* ato_err_library ( ato_Err err)

Get the library (string) where the error was created.

Parameters
errerror object
Returns
library name

◆ ato_err_module()

ATO_EXPORT const char* ato_err_module ( ato_Err err)

Get the module (file) where the error was created.

Parameters
errerror object
Returns
module name

◆ ato_err_function()

ATO_EXPORT const char* ato_err_function ( ato_Err err)

Get the function where the error was created.

Parameters
errerror object
Returns
function name

◆ ato_err_line()

ATO_EXPORT int ato_err_line ( ato_Err err)

Get the line where the error was created.

Parameters
errerror object
Returns
line number

◆ ato_err_msg()

ATO_EXPORT const char* ato_err_msg ( ato_Err err)

Get the message attached to the error.

Parameters
errerror object
Returns
message

◆ ato_err_inner()

ATO_EXPORT ato_Err* ato_err_inner ( ato_Err err)

Get the nested/inner error object if any.

Parameters
errerror object
Returns
inner error

◆ ato_err_custom()

ATO_EXPORT void* ato_err_custom ( ato_Err err)

Get the custom object if any.

Parameters
errerror object
Returns
custom object