try { ... }
statement and that you provide the required catch () { ... }
statements to process the exceptions.There are essentially two types of exceptions that will be thrown by the SPARK solver:
SPARK::TProblem* P = 0; try { ... } catch (const SPARK::XAssertion& x1) { // SPARK specific exceptions SPARK::ExitWithError( x1.code(), __FILE__, x1.message(), P // Specifiy active problem to ensure proper diagnostic ); } catch (const std::exception& x2) { // std exceptions SPARK::ExitWithError( SPARK::ExitCode_ERROR_RUNTIME_ERROR, __FILE__, x2.what(), P // Specifiy active problem to ensure proper diagnostic ); } return SPARK::ExitCode_OK;
Note that the catch
statements in the default driver exit the simulator by invoking the API function SPARK::ExitWithError().