2
3
6
7
8
9
10
11
13#include <so_5/impl/process_unhandled_exception.hpp>
15#include <so_5/environment.hpp>
17#include <so_5/details/abort_on_fatal_error.hpp>
18#include <so_5/details/suppress_exceptions.hpp>
27
28
29
30
31
32
33
51 catch(
const std::exception & x )
58 log_stream <<
"An exception '" << x.what()
59 <<
"' during deregistring cooperation "
60 << coop <<
" on unhandled exception"
61 "processing. Application will be aborted.";
68
69
70
71
72
73
74
75
79 agent_t & a_exception_producer )
noexcept
89 catch(
const std::exception & x )
96 log_stream <<
"An exception '" << x.what()
97 <<
"' during shutting down SObjectizer on unhandled "
98 "exception processing. Application will be aborted.";
105
106
107
108
109
110
111
112
116 const std::exception & ex_to_log,
118 agent_t & a_exception_producer )
noexcept
132 current_thread_id_t working_thread_id,
133 const std::exception & ex,
134 agent_t & a_exception_producer )
noexcept
146 log_stream <<
"Illegal exception_reaction code "
147 "for the multithreadded agent: "
148 <<
static_cast<
int >(reaction) <<
". "
149 "The only allowed exception_reaction for "
150 "such kind of agents are ignore_exception or "
151 "abort_on_exception. "
152 "Application will be aborted. "
153 "Unhandled exception '" << ex.what()
154 <<
"' from cooperation "
165 log_stream <<
"Application will be aborted due to unhandled "
166 "exception '" << ex.what() <<
"' from cooperation "
177 log_stream <<
"SObjectizer will be shutted down due to "
178 "unhandled exception '" << ex.what()
179 <<
"' from cooperation "
185 a_exception_producer
);
193 log_stream <<
"Cooperation "
195 <<
" will be deregistered due to unhandled exception '"
201 a_exception_producer
);
209 log_stream <<
"Ignore unhandled exception '"
210 << ex.what() <<
"' from cooperation "
220 log_stream <<
"Unknown exception_reaction code: "
221 <<
static_cast<
int >(reaction)
222 <<
". Application will be aborted. Unhandled exception '"
223 << ex.what() <<
"' from cooperation "
232 current_thread_id_t working_thread_id,
233 agent_t & a_exception_producer )
noexcept
237 "an exception of unknown type is caught",
244 a_exception_producer
);
void so_switch_to_awaiting_deregistration_state()
Switching agent to special state in case of unhandled exception.
coop_handle_t so_coop() const
Get a handle of agent's coop.
virtual exception_reaction_t so_exception_reaction() const noexcept
A reaction from SObjectizer to an exception from agent's event.
environment_t & so_environment() const noexcept
Access to the SObjectizer Environment which this agent is belong.
Type of smart handle for a cooperation.
void call_exception_logger(const std::exception &event_exception, const coop_handle_t &coop) noexcept
Call event exception logger for logging an exception.
void stop() noexcept
Send a shutdown signal to the Run-Time.
void deregister_coop(coop_handle_t coop, int reason) noexcept
Deregister the cooperation.
The base class for all SObjectizer exceptions.
exception_t(const std::string &error_descr, int error_code)
#define SO_5_LOG_ERROR(logger, var_name)
A special macro for helping error logging.
Enumeration of cooperation deregistration reasons.
const int unhandled_exception
Deregistration because of unhandled exception.
Some reusable and low-level classes/functions which can be used in public header files.
void abort_on_fatal_error(L logging_lambda) noexcept
void suppress_exceptions(Lambda &&lambda) noexcept
Helper function for execution a block of code with suppression of any exceptions raised inside that b...
void switch_agent_to_special_state_and_deregister_coop(so_5::agent_t &a_exception_producer) noexcept
Switch agent to special state and deregister its cooperation.
void log_unhandled_exception(const std::exception &ex_to_log, agent_t &a_exception_producer) noexcept
Log unhandled exception from cooperation.
void switch_agent_to_special_state_and_shutdown_sobjectizer(agent_t &a_exception_producer) noexcept
Switch agent to special state and initiate stopping of SObjectizer Environment.
Details of SObjectizer run-time implementations.
void process_unhandled_unknown_exception(current_thread_id_t working_thread_id, agent_t &a_exception_producer) noexcept
Processor of unhandled exception of unknown type from agent's event handler.
void process_unhandled_exception(current_thread_id_t working_thread_id, const std::exception &ex, agent_t &a_exception_producer) noexcept
Processor of unhandled exception from agent's event handler.
Private part of message limit implementation.
@ abort_on_exception
Execution of application must be aborted immediatelly.
@ ignore_exception
Exception should be ignored and agent should continue its work.
@ deregister_coop_on_exception
@ shutdown_sobjectizer_on_exception
current_thread_id_t null_current_thread_id()
Get NULL thread id.
const int rc_unknown_exception_type
An exception of unknown type is caught.