HermesCommon  3.0
Hermes::Exceptions::Exception Class Reference

Exception interface Basically a std::exception, but with a constructor with string and with print_msg method. Usage: try {  ...  throw Hermes::Exceptions::Exception("this is an exception message"); } catch(Hermes::Exceptions::Exception& e) {  e.print_msg(); }. More...

#include <exceptions.h>

+ Inheritance diagram for Hermes::Exceptions::Exception:

Public Member Functions

 Exception ()
 Init exception with default message.
 
 Exception (const Exception &e)
 
 Exception (const char *msg,...)
 
void print_msg () const
 print error message to stderr
 
virtual const char * what () const throw ()
 get pointer to error message
 
std::string info () const
 
const char * get_func_name () const
 

Protected Attributes

std::stringstream message
 
char message_char [10000]
 To be compatible with what().
 

Detailed Description

Exception interface Basically a std::exception, but with a constructor with string and with print_msg method. Usage: try {  ...  throw Hermes::Exceptions::Exception("this is an exception message"); } catch(Hermes::Exceptions::Exception& e) {  e.print_msg(); }.

Definition at line 49 of file exceptions.h.

Constructor & Destructor Documentation

Hermes::Exceptions::Exception::Exception ( const char *  msg,
  ... 
)

Init exception with message.

Parameters
[in]msgmessage

Definition at line 35 of file exceptions.cpp.

Member Function Documentation

const char* Hermes::Exceptions::Exception::get_func_name ( ) const
Returns
name of function where exception was created.

The documentation for this class was generated from the following files: