Intel DAAL provides classes and methods to handle exceptions or errors that can occur during library operation.
The methods of the library return the following computation set status:
- Success - no errors detected
- Warning - recoverable errors detected
- Failure - unrecoverable errors detected
In Intel DAAL C++ interfaces, the base class for error handling is Status. If the execution of the library methods provided by the Algorithm or Data Management classes is unsuccessful, the Status object returned by the respective routines contains the list of errors and/or warnings extended with additional details about the error conditions. The class includes the list of the following methods for error processing:
Checks whether the Status object contains any unrecoverable errors.
Adds information about the error, such as the error identifier or the pointer to the error.
Returns the detailed description of the errors contained in the object.
Removes information about the errors from the object.
The error class in Intel DAAL C++ interfaces is Error. This class contains an error message and details of the issue. For example, an Error object can store the number of the row in the NumericTable that caused the issue or a message that an SQL database generated to describe the reasons of an unsuccessful query. A single Error object can store the error description and an arbitrary number of details of various types: integer or double values or strings.
The class includes the list of the following methods for error processing:
Returns the identifier of the error.
Sets the identifier of the error.
Returns the detailed description of the error.
Adds data type-based details to the error.
Creates an instance of the Error class with the given set of arguments.
By default, the compute() method of the library algorithms throws run-time exception when error is detected. To prevent throwing any exceptions, call the computeNoThrow() method.
Service methods of the algorithms, such as setResult() and setPartialResult(), do not throw exceptions and return the status of the respective operation.
The methods of the Data Management classes do not throw exceptions and return the status of the respective operation.
Intel DAAL Java* interfaces handle errors by throwing Java exceptions.