# Error Handling

## Functions
DLLEXPORT const wchar_t *CALL | tecella_error_message (TECELLA_ERRNUM errnum)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_error_set_callback (TECELLA_HNDL h, TECELLA_ERR_CB f)

## Detailed Description

Almost all functions in this API return a TECELLA_ERRNUM error code. tecella_error_message() helps translate the error code into a meaningful message that can be displayed to the user. tecella_error_set_callback() can help you make sure you never miss an error returned by the API.

## Function Documentation

DLLEXPORT const wchar_t* CALL tecella_error_message | ( | TECELLA_ERRNUM | errnum | ) |

Retreives the message string associated with an error value.

Parameters:

  | errnum | The error returned by any of the API functions.

Returns:
  The message string.

DLLEXPORT TECELLA_ERRNUM CALL tecella_error_set_callback | ( | TECELLA_HNDL | h,
|  | TECELLA_ERR_CB | f |
| ) |  |  |

Sets a callback function to be called upon an error. Very useful for debugging and catching all errors if you accidentally forget to check a return code.

Parameters:

  | h | A handle to an initialized device.
  | f | The error callback function.