Skip to content

EntropyEngine::Core::Concurrency::NodeFailedEvent

EntropyEngine::Core::Concurrency::NodeFailedEvent

Section titled “EntropyEngine::Core::Concurrency::NodeFailedEvent”

Uh oh - a node threw an exception. More…

#include <WorkGraphEvents.h>

Inherits from EntropyEngine::Core::Concurrency::WorkGraphEvent

Name
NodeFailedEvent(const WorkGraph * g, NodeHandle n, std::exception_ptr ex =nullptr)
Name
NodeHandlenode
The node that failed.
std::exception_ptrexception
What was thrown (may be null).

Public Functions inherited from EntropyEngine::Core::Concurrency::WorkGraphEvent

Name
WorkGraphEvent(const WorkGraph * g)

Public Attributes inherited from EntropyEngine::Core::Concurrency::WorkGraphEvent

Name
std::chrono::steady_clock::time_pointtimestamp
When this event was created.
const WorkGraph *graph
Which graph emitted this event.
struct EntropyEngine::Core::Concurrency::NodeFailedEvent;

Uh oh - a node threw an exception.

When a node’s work function throws, this event captures the failure. The exception is preserved as exception_ptr so you can rethrow it for debugging or log the details. Remember: node failure triggers cancellation of all dependent nodes!

eventBus->subscribe<NodeFailedEvent>([](const auto& event) {
LOG_ERROR("Node {} failed!", event.node.getData()->name);
if (event.exception) {
try {
std::rethrow_exception(event.exception);
} catch (const std::exception& e) {
LOG_ERROR(" Reason: {}", e.what());
} catch (...) {
LOG_ERROR(" Reason: Unknown exception");
}
}
});
inline NodeFailedEvent(
const WorkGraph * g,
NodeHandle n,
std::exception_ptr ex =nullptr
)
NodeHandle node;

The node that failed.

std::exception_ptr exception;

What was thrown (may be null).


Updated on 2026-01-26 at 17:14:35 -0500