#include <dai/exceptions.h>
Public Types | |
enum | Code { NOT_IMPLEMENTED, ASSERTION_FAILED, IMPOSSIBLE_TYPECAST, OBJECT_NOT_FOUND, BELIEF_NOT_AVAILABLE, UNKNOWN_ENUM_VALUE, UNKNOWN_DAI_ALGORITHM, UNKNOWN_PARAMETER_ESTIMATION_METHOD, UNKNOWN_PROPERTY_TYPE, UNKNOWN_PROPERTY, MALFORMED_PROPERTY, NOT_ALL_PROPERTIES_SPECIFIED, INVALID_ALIAS, CANNOT_READ_FILE, CANNOT_WRITE_FILE, INVALID_FACTORGRAPH_FILE, INVALID_EVIDENCE_FILE, INVALID_EMALG_FILE, NOT_NORMALIZABLE, MULTIPLE_UNDO, FACTORGRAPH_NOT_CONNECTED, INTERNAL_ERROR, RUNTIME_ERROR, OUT_OF_MEMORY, NUM_ERRORS } |
Enumeration of exceptions used in libDAI. More... | |
Public Member Functions | |
Exception (Code _code, const std::string &msg="", const std::string &detailedMsg="") | |
Constructor. | |
Code | code () const |
Returns error code of this exception. | |
const std::string & | message (const Code c) const |
Returns error message corresponding to an error code. | |
Private Attributes | |
Code | errorcode |
Contains the error code of this exception. | |
Static Private Attributes | |
static std::string | ErrorStrings [NUM_ERRORS] |
Error messages corresponding to the exceptions enumerated above. |
The Exception class inherits from std::runtime_error. It defines several types of exceptions and corresponding error messages. The recommended way to throw an instance of the Exception class is by using the DAI_THROW or DAI_THROWE macros.
enum dai::Exception::Code |
Enumeration of exceptions used in libDAI.
dai::Exception::Exception | ( | Code | _code, | |
const std::string & | msg = "" , |
|||
const std::string & | detailedMsg = "" | |||
) | [inline] |
Constructor.
Code dai::Exception::code | ( | ) | const [inline] |
Returns error code of this exception.
const std::string& dai::Exception::message | ( | const Code | c | ) | const [inline] |
Returns error message corresponding to an error code.
Code dai::Exception::errorcode [private] |
Contains the error code of this exception.
std::string dai::Exception::ErrorStrings [static, private] |
Initial value:
{ "Feature not implemented", "Assertion failed", "Impossible typecast", "Requested object not found", "Requested belief not available", "Unknown ENUM value", "Unknown DAI algorithm", "Unrecognized parameter estimation method", "Unknown Property type", "Unknown Property", "Malformed Property", "Not all mandatory Properties specified", "Invalid alias", "Cannot read file", "Cannot write file", "Invalid FactorGraph file", "Invalid Evidence file", "Invalid Expectation-Maximization file", "Quantity not normalizable", "Multiple undo levels unsupported", "FactorGraph is not connected", "Internal error", "Runtime error", "Out of memory" }