Application Programmers Manual: Error Handling
From DSL
The library is designed with the purpose of minimizing errors and, when they appear, to recover gracefully from them. Errors are usually signaled by a function returning a negative number. The meaning of this number is defined in the file errors.h and more information can be found in the appendixes. If nothing unusual happened, the return value is DSL_OKAY. Most errors are logged into a global instance of the class DSL_errorStringHandler. This object can be accessed through the network method ErrorHandler() and can be queried to obtain detailed information of the error conditions detected. Some of its methods are:
- Flush() will discard any errors logged so far.
- GetNumberOfErrors() returns the number of errors logged since the last call to Flush.
- GetError() lets you ask for a determined error code specifying its index. The error codes returned are defined in the file errors.h.
- GetErrorMessage() gives you the string associated with a given error condition. This string usually gives detailed and customized information about the conditions in which the error appeared. The string returned is terminated by a period but not by a carriage return character. If no errors were logged, this function will return the string "No errors so far".
