An exception class carrying an error message and, optionally, the index of the step in which the error occurred.
Error is used as the standard exception class by many functions throughout Taskolib. It can be used directly or inherited from.
try
{
}
{
std::cerr << e.what() << "\n";
}
try
{
}
{
std::cerr << e.what();
if (maybe_step_index)
std::cerr << ": step index " << *maybe_step_index;
std::cerr << "\n";
}
An exception class carrying an error message and, optionally, the index of the step in which the erro...
Definition: exceptions.h:73
OptionalStepIndex get_index() const
Return the associated step index.
Definition: exceptions.h:86
- Note
- task::Error is derived from std::runtime_error. It can therefore be caught by
catch (const std::exception&)
, catch (const std::runtime_error&)
, and catch (const task::Error&)
.