SObjectizer  5.5
Namespaces | Functions
abort_on_fatal_error.hpp File Reference

Helpers for aborting the whole application in the case of a fatal error. More...

#include <so_5/details/invoke_noexcept_code.hpp>
#include <cstdlib>
#include <utility>

Go to the source code of this file.

Namespaces

 so_5
 Public part of message limit implementation.
 
 so_5::details
 Some reusable and low-level classes/functions which can be used in public header files.
 

Functions

template<typename L >
void so_5::details::abort_on_fatal_error (L logging_lambda) noexcept
 

Detailed Description

Helpers for aborting the whole application in the case of a fatal error.

Helper for aborting the whole application in the case of a fatal error.

Since
v.5.5.6
v.5.5.6
Template Parameters
Ltype of lambda with logging action. Note that this lambda must not throws exceptions.
Usage example
if( coop_t::COOP_NOT_REGISTERED == m_agent_coop->m_registration_status )
SO_5_LOG_ERROR( so_environment(), log_stream )
{
log_stream << "Unexpected error: agent_coop has status "
"COOP_NOT_REGISTERED at demand_handler_on_start. "
"Cooperation: " << m_agent_coop->query_coop_name()
<< ". Application will be aborted" << std::endl;
}
} );