Reference documentation for deal.II version 8.5.1
Enumerations | Functions
deal_II_exceptions::internals Namespace Reference

Enumerations

enum  ExceptionHandling { abort_on_exception, throw_on_exception, abort_nothrow_on_exception }
 

Functions

void abort (const ExceptionBase &exc, bool nothrow=false)
 
template<class exc >
void issue_error (ExceptionHandling handling, const char *file, int line, const char *function, const char *cond, const char *exc_name, exc e)
 

Detailed Description

The functions in this namespace are in connection with the Assert and AssertThrow mechanism but are solely for internal purposes and are not for use outside the exception handling and throwing mechanism.

Enumeration Type Documentation

◆ ExceptionHandling

An enum describing how to treat an exception in issue_error.

Enumerator
abort_on_exception 

Abort the program by calling std::abort unless deal_II_exceptions::disable_abort_on_exception has been called: in that case the program will throw an exception.

throw_on_exception 

Throw the exception normally.

abort_nothrow_on_exception 

Call std::abort as long as deal_II_exceptions::disable_abort_on_exception has not been called: if it has, then just print a description of the exception to deallog.

Definition at line 244 of file exceptions.h.

Function Documentation

◆ abort()

void deal_II_exceptions::internals::abort ( const ExceptionBase exc,
bool  nothrow = false 
)

Conditionally abort the program.

Depending on whether deal_II_exceptions::disable_abort_on_exception was called, this function either aborts the program flow by printing the error message provided by exc and calling std::abort(), or throws exc instead (if nothrow is set to false).

If the boolean nothrow is set to true and deal_II_exceptions::disable_abort_on_exception was called, the exception type is just printed to deallog and program flow continues. This is useful if throwing an exception is prohibited (e.g. in a destructor with noexcept(true) or throw()).

Definition at line 409 of file exceptions.cc.

◆ issue_error()

template<class exc >
void deal_II_exceptions::internals::issue_error ( ExceptionHandling  handling,
const char *  file,
int  line,
const char *  function,
const char *  cond,
const char *  exc_name,
exc  e 
)

This routine does the main work for the exception generation mechanism used in the Assert macro.

ExceptionBase

Definition at line 271 of file exceptions.h.