Google Cloud C++ Client  2.7.0
C++ Client Library for Google Cloud Platform
Typedefs | Functions
Control behavior on unrecoverable errors.

If exceptions are not enabled via GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS, calling any function from throw_delegate.h will result in calling the handler installed via this API. More...

Typedefs

using google::cloud::TerminateHandler = std::function< void(char const *msg)>
 Terminate handler. More...
 

Functions

TerminateHandler google::cloud::SetTerminateHandler (TerminateHandler f)
 Install terminate handler and get the old one atomically. More...
 
TerminateHandler google::cloud::GetTerminateHandler ()
 Get the currently installed handler. More...
 
void google::cloud::Terminate (char const *msg)
 Invoke the currently installed handler. More...
 

Detailed Description

If exceptions are not enabled via GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS, calling any function from throw_delegate.h will result in calling the handler installed via this API.

By default, the library calls std::abort().

Typedef Documentation

◆ TerminateHandler

using google::cloud::TerminateHandler = typedef std::function<void(char const* msg)>

Terminate handler.

It should handle the error, whose description are given in msg and should never return.

Definition at line 40 of file terminate_handler.h.

Function Documentation

◆ GetTerminateHandler()

TerminateHandler google::cloud::GetTerminateHandler ( )

Get the currently installed handler.

Returns
The currently installed handler.

◆ SetTerminateHandler()

TerminateHandler google::cloud::SetTerminateHandler ( TerminateHandler  f)

Install terminate handler and get the old one atomically.

Parameters
fthe handler. It should never return, behaviour is undefined otherwise.
Returns
Previously set handler.

◆ Terminate()

void google::cloud::Terminate ( char const *  msg)

Invoke the currently installed handler.

Parameters
msgDetails about the error.

This function should never return.