Central error handler integrating logging and exceptions.
More...
#include <ErrorHandler.hpp>
Central error handler integrating logging and exceptions.
Bridges the gap between:
◆ ErrorHandler()
| icarus::ErrorHandler::ErrorHandler |
( |
LogService & | log_service | ) |
|
|
inlineexplicit |
◆ GetErrorCount()
| std::size_t icarus::ErrorHandler::GetErrorCount |
( |
Severity | severity | ) |
const |
|
inlinenodiscard |
Get count of errors at each severity.
◆ GetFatalError()
| std::optional< SimulationError > icarus::ErrorHandler::GetFatalError |
( |
| ) |
const |
|
inlinenodiscard |
Get the first fatal error (if any).
◆ GetTotalErrorCount()
| std::size_t icarus::ErrorHandler::GetTotalErrorCount |
( |
| ) |
const |
|
inlinenodiscard |
Get total error count (WARNING and above).
◆ ProcessBufferedErrors()
| bool icarus::ErrorHandler::ProcessBufferedErrors |
( |
| ) |
|
|
inlinenodiscard |
Check buffered logs for errors, apply policies. Called by Simulator after Flush().
- Returns
- true if simulation should abort (fatal error or max errors exceeded)
◆ Report() [1/2]
| ErrorPolicy icarus::ErrorHandler::Report |
( |
const Error & | exception, |
|
|
double | sim_time = 0.0, |
|
|
const std::string & | component = "" ) |
|
inline |
Report an exception, extracting info automatically.
◆ Report() [2/2]
Report an error (from exception or direct call) Returns the policy that should be applied
◆ ReportFatal()
| void icarus::ErrorHandler::ReportFatal |
( |
const std::string & | message, |
|
|
double | sim_time = 0.0 ) |
|
inline |
Report a fatal error and trigger crash.
◆ Reset()
| void icarus::ErrorHandler::Reset |
( |
| ) |
|
|
inline |
Clear error counts (for new run).
◆ SetCallback()
Set callback for error handling (can override default policy).
◆ SetMaxErrors()
| void icarus::ErrorHandler::SetMaxErrors |
( |
std::size_t | max_errors | ) |
|
|
inline |
Set maximum errors before automatic abort.
◆ SetPolicy()
Set default policy for each severity level.
◆ ShouldAbort()
| bool icarus::ErrorHandler::ShouldAbort |
( |
| ) |
const |
|
inlinenodiscard |
Check if simulation should abort.
The documentation for this class was generated from the following file: