Opm::Exc::Base Struct Reference

#include <exc.hpp>

Inheritance diagram for Opm::Exc::Base:
Inheritance graph

Public Member Functions

virtual Baseoperator() (char const *fmt,...)
 Add a message to the string. More...
 
virtual char const * what () const throw ()
 Message created at the throw-site about the error. More...
 

Detailed Description

Base class for exceptions thrown from the OPM framework.

Throw exceptions like this:

throw OPM_EXC ("Magic value = %d", 42);

Catch exceptions like this:

catch (std::exception& ex) { std::cerr << OPM_WHAT (ex) << std::endl; exit (-1); }

Member Function Documentation

virtual Base& Opm::Exc::Base::operator() ( char const *  fmt,
  ... 
)
virtual

Add a message to the string.

Parameters
fmtprintf-style format string. The rest of the parameters are formatted according to this string.
Returns
Same exception object so it can be chained. (In particular, more boost::error_info objects may be added).
virtual char const* Opm::Exc::Base::what ( ) const
throw (
)
virtual

Message created at the throw-site about the error.

Returns
String that can be printed in the log about the exception.

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