summaryrefslogtreecommitdiff
path: root/cesar/maximus/utils/src/Error.cpp
blob: cdf6ca4f9c8030d4b575ccfb705ab42287e7f054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "Error.h"

#include "Logger.h"

#include <iostream> // for 'cout', 'cerr' and 'clog'
#include <cstring> // strerror


Error::Error ( const string & my_function, const string & msg, const error_t my_errno ) : runtime_error(msg)
{
  mErrorId = my_errno;
  mFunction = my_function;
}


void Error::display ( ) const
{
  cerr << endl << "*** Error in " << mFunction << endl << "\t" << what() << " (" << strerror(mErrorId) << ") ***" << endl;
#if CONFIG_LOG
  clog << endl << logger(LOG_FATAL) << "*** Error in " << mFunction << endl << "\t" << what() << " (" << strerror(mErrorId) << ") ***" << endl;
#endif /* CONFIG_LOG */
}


Error::~Error ( ) throw()
{

}