Flow123d  JS_before_hm-2213-g29638ef6f
Classes | Namespaces | Macros | Functions
exceptions.hh File Reference


More...

#include <stdlib.h>
#include <boost/exception/detail/error_info_impl.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/throw_exception.hpp>
#include <exception>
#include <type_traits>
#include <vector>
#include <iostream>
#include <string>
#include <memory>
#include "system/stack_trace.hh"

Go to the source code of this file.

Classes

class  ExceptionBase
 Base of exceptions used in Flow123d. More...
 
class  EI< Tag, Type >
 
class  internal::NullOutputEnvelope< Type >
 
class  internal::ExcStream
 

Namespaces

 internal
 

Macros

#define THROW(whole_exception_expr)   BOOST_THROW_EXCEPTION( whole_exception_expr)
 Wrapper for throw. Saves the throwing point. More...
 
#define DECLARE_EXCEPTION(ExcName, Format)
 Macro for simple definition of exceptions. More...
 
#define TYPEDEF_ERR_INFO(EI_Type, Type)   typedef EI< struct EI_Type##_TAG, Type > EI_Type
 Macro to simplify declaration of error_info types. More...
 

Functions

 TYPEDEF_ERR_INFO (EI_Nested, std::shared_ptr< ExceptionBase >)
 Error info of previous exception. More...
 
 TYPEDEF_ERR_INFO (EI_NestedMessage, std::string)
 
template<class Exc >
EI_Nested make_nested_ei (Exc &e)
 
template<class Exc >
EI_NestedMessage make_nested_message (Exc &e)
 
template<class Type >
std::ostream & internal::operator<< (std::ostream &stream, const NullOutputEnvelope< Type > &value)
 
template<class T >
ExcStream & internal::operator<< (ExcStream &estream, const T &x)
 
template<class Tag , class Type , class Func >
internal::ExcStreaminternal::operator<< (internal::ExcStream &estream, typename EI< Tag, Type >::template lambda< Func > const &lambda_func)
 

Detailed Description


 * Copyright (C) 2015 Technical University of Liberec. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Definition in file exceptions.hh.

Function Documentation

◆ make_nested_ei()

template<class Exc >
EI_Nested make_nested_ei ( Exc &  e)

Create EI_Nested error info with given exception.

Used for propagation exception message.

Definition at line 272 of file exceptions.hh.

Here is the caller graph for this function:

◆ make_nested_message()

template<class Exc >
EI_NestedMessage make_nested_message ( Exc &  e)

Propagate just the 'what' message for exceptions that are not derived from ExceptionBase.

Definition at line 285 of file exceptions.hh.

Here is the caller graph for this function:

◆ TYPEDEF_ERR_INFO() [1/2]

TYPEDEF_ERR_INFO ( EI_Nested  ,
std::shared_ptr< ExceptionBase  
)

Error info of previous exception.

Allows keep and propagate message when one exception is catched and other exception is thrown. Catched exception is stored to EI_Nested and is printed out to message of thrown exception.

Example of usage:

try {
// method next() throws ExcA
obj.next();
} catch ( ExcA &e ) {
// add ExcA to EI tags of ExcB
THROW( ExcB() << make_nested_ei(e)) );
}

◆ TYPEDEF_ERR_INFO() [2/2]

TYPEDEF_ERR_INFO ( EI_NestedMessage  ,
std::string   
)
make_nested_ei
EI_Nested make_nested_ei(Exc &e)
Definition: exceptions.hh:272
THROW
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
Definition: exceptions.hh:53