Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
kcenon::common::concepts::ErrorEvent Concept Referenceexport

An event type representing an error. More...

#include <event.h>

Concept definition

template<typename T>
concept kcenon::common::concepts::ErrorEvent = EventType<T> && requires(const T t) {
{ t.error_message } -> std::convertible_to<std::string>;
{ t.error_code } -> std::convertible_to<int>;
}
An event type representing an error.
Definition event.h:155
A type that can be used as an event in the event bus.
Definition event.h:52

Detailed Description

An event type representing an error.

Error events include error message and error code for diagnostic purposes.

Example usage:

template<ErrorEvent E>
void handle_error(const E& event) {
std::cerr << "Error " << event.error_code << ": "
<< event.error_message << std::endl;
}

Definition at line 155 of file event.h.