RESTinio
Loading...
Searching...
No Matches
restinio::abort_app_in_error_callback_t Struct Reference

Type of a function to be used as the default on_error-callback. More...

#include <http_server_run.hpp>

Public Member Functions

void operator() (std::exception_ptr) const noexcept

Detailed Description

Type of a function to be used as the default on_error-callback.

Since v.0.7.0 on_pool_runner_t::stop() accept a on_error callback that will be passed to http_server_t::close_async() and will be called if an exception is thrown in http_server_t::close_async(). This callback should perform some actions that can help the application to handle the problem.

This type is intended to be used as the default on_error callback.

If an exception in thrown inside http_server_t::close_async() then the application is in undefined state, it's unknown what can be done with http_server_t instance and whan can't be.

Therefore the default on_error callback simply calls std::abort() to terminate the application and avoid the work in undefined state.

If such behavour is not desirable the user can provide own on_error callback.

Since
v.0.7.0

Definition at line 712 of file http_server_run.hpp.

Member Function Documentation

◆ operator()()

void restinio::abort_app_in_error_callback_t::operator() ( std::exception_ptr ) const
inlinenoexcept
Attention
It just calls std::abort().

Definition at line 720 of file http_server_run.hpp.


The documentation for this struct was generated from the following file: