4 #ifndef DUNE_EXCEPTIONS_HH
5 #define DUNE_EXCEPTIONS_HH
94 void message(
const std::string &msg);
95 const std::string&
what()
const;
181 if (_hook != 0) _hook->operator()();
206 return stream << e.
what();
213 #define THROWSPEC(E) # E << " [" << __func__ << ":" << __FILE__ << ":" << __LINE__ << "]: "
243 #define DUNE_THROW(E, m) do { E th__ex; std::ostringstream th__out; \
244 th__out << THROWSPEC(E) << m; th__ex.message(th__out.str()); throw th__ex; \
static void clearHook()
remove all hooks
Definition: exceptions.hh:189
Default exception class for I/O errors.
Definition: exceptions.hh:256
virtual ~ExceptionHook()
Definition: exceptions.hh:170
Default exception if an error in the parallel communication of the programm occured.
Definition: exceptions.hh:312
std::ostream & operator<<(std::ostream &s, const array< T, N > &e)
Output operator for array.
Definition: array.hh:26
Exception()
Definition: exceptions.hh:178
const std::string & what() const
output internal message buffer
Definition: exceptions.hh:199
Default exception for dummy implementations.
Definition: exceptions.hh:288
Default exception class for mathematical errors.
Definition: exceptions.hh:266
void message(const std::string &msg)
store string in internal message buffer
Definition: exceptions.hh:194
static void registerHook(ExceptionHook *hook)
add a functor which is called before a Dune::Exception is emitted (see Dune::ExceptionHook) ...
Definition: exceptions.hh:184
Default exception if a function was called while the object is not in a valid state for that function...
Definition: exceptions.hh:306
virtual void operator()()=0
Base class to add a hook to the Dune::Exception.
Definition: exceptions.hh:168
Default exception class for OS errors.
Definition: exceptions.hh:296
Default exception class for range errors.
Definition: exceptions.hh:279
Default exception if memory allocation fails.
Definition: exceptions.hh:301
Base class for Dune-Exceptions.
Definition: exceptions.hh:91