FOSSredder 0.5.0
Loading...
Searching...
No Matches
IErrorReporter.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <exception>
9
12
14
19public:
23 virtual ~IErrorReporter() = default;
24
29 virtual void report(const core::errors::ErrorEvent &event) = 0;
30
38 const char *origin,
39 std::exception_ptr exception) {
40 report(core::errors::makeExceptionEvent(severity, nullptr, origin,
41 exception));
42 }
43};
44
45} // namespace core::ports::diagnostics
Declares structured error event payloads.
Declares helpers for turning exceptions into structured error events.
Port for reporting structured diagnostic error events.
virtual ~IErrorReporter()=default
Destroy the error reporter port.
virtual void reportException(core::errors::ErrorSeverity severity, const char *origin, std::exception_ptr exception)
Report an exception as a structured error event.
virtual void report(const core::errors::ErrorEvent &event)=0
Report a structured error event.
ErrorSeverity
Severity level for structured error events.
Definition ErrorEvent.h:17
ErrorEvent makeExceptionEvent(ErrorSeverity severity, const char *code, const char *origin, std::exception_ptr exception, ErrorContext context={})
Build a structured event from an exception pointer.
Structured error payload sent through diagnostics ports.
Definition ErrorEvent.h:32