#include <libthrowable/user_fault.h>
Public Member Functions | |
UserFault (const std::string &msg) throw () | |
Constructs a new UserFault from msg. | |
UserFault (const char *filename, int linenumber, const std::string &msg) throw () | |
Constructs a new UserFault from filename, linenumber and msg. | |
UserFault (const char *filename, int linenumber, const char *function, const std::string &msg) throw () | |
Constructs a new UserFault from filename, linenumber, function and msg. | |
UserFault (const std::exception &cause, const std::string &msg) throw () | |
Constructs a new UserFault from cause. | |
virtual const std::string & | getMessage () const throw () |
Returns an error message targeted at the end user. | |
virtual | ~UserFault () throw () |
Protected Member Functions | |
UserFault (const std::string &msg, const std::string &passUnmodifiedToException) throw () | |
You may want to use this constructor when derivin classes from this one. | |
std::string & | getInternalMessage () throw () |
Gives you a refernce to the string that defines the return value of getMessage(). |
if(parsing_failed) throw UserFault("not a valid expression: " + expr);
try { double result = calculator.parseExpr(expr); cout << "expr = " << result; } catch(const UserFault& fault) { cout << fault << endl; }
libthrowable::UserFault::UserFault | ( | const std::string & | msg | ) | throw () [explicit] |
Constructs a new UserFault from msg.
msg | This should be an (possibly) translated error message for the user, not for you as programmer. |
libthrowable::UserFault::UserFault | ( | const char * | filename, | |
int | linenumber, | |||
const std::string & | msg | |||
) | throw () |
Constructs a new UserFault from filename, linenumber and msg.
libthrowable::UserFault::UserFault | ( | const char * | filename, | |
int | linenumber, | |||
const char * | function, | |||
const std::string & | msg | |||
) | throw () |
Constructs a new UserFault from filename, linenumber, function and msg.
libthrowable::UserFault::UserFault | ( | const std::exception & | cause, | |
const std::string & | msg | |||
) | throw () |
Constructs a new UserFault from cause.
virtual libthrowable::UserFault::~UserFault | ( | ) | throw () [virtual] |
libthrowable::UserFault::UserFault | ( | const std::string & | msg, | |
const std::string & | passUnmodifiedToException | |||
) | throw () [protected] |
You may want to use this constructor when derivin classes from this one.
msg | This string defines the return value of getMessage() as long as you don't overide this method. | |
passUnmodifiedToException | This string defines the return value of what() as long as you don't override this method. |
virtual const std::string& libthrowable::UserFault::getMessage | ( | ) | const throw () [virtual] |
Returns an error message targeted at the end user.
std::string& libthrowable::UserFault::getInternalMessage | ( | ) | throw () [protected] |
Gives you a refernce to the string that defines the return value of getMessage().