26 namespace exception_detail
61 std::ostringstream str;
68 std::ostringstream str;
72 return _(str.str().c_str());
107 std::string history(
_(
"History:") );
108 std::ostringstream ret;
110 "", history+
"\n - ",
"\n - ",
"\n",
"" );
115 {
return str <<
_msg; }
129 std::string ret( msg_r );
135 const char *
const prefix_r )
137 INT << where_r <<
" " << prefix_r <<
" " << excpt_r.
asUserHistory() << endl;
std::string historyAsString() const
The history as string.
std::ostream & operator<<(std::ostream &str, const CodeLocation &obj)
bool historyEmpty() const
Whether the history list is empty.
static std::string strErrno(int errno_r)
Make a string from errno_r.
void addHistory(const std::string &msg_r)
Add some message text to the history.
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
HistoryIterator historyBegin() const
Iterator pointing to the most recent message.
void remember(const Exception &old_r)
Store an other Exception as history.
static void log(const Exception &excpt_r, const CodeLocation &where_r, const char *const prefix_r)
Drop a logline on throw, catch or rethrow.
std::ostream & dumpRange(std::ostream &str, _Iterator begin, _Iterator end, const std::string &intro="{", const std::string &pfx="\n ", const std::string &sep="\n ", const std::string &sfx="\n", const std::string &extro="}")
Print range defined by iterators (multiline style).
std::ostream & operator<<(std::ostream &str, const Exception &obj)
std::list< std::string > History
std::ostream & dumpError(std::ostream &str) const
Called by std::ostream & operator<<.
std::string asString() const
Error message provided by dumpOn as string.
virtual ~Exception()
Dtor.
#define _(MSG)
Return translated text.
std::string asString() const
Location as string.
std::string form(const char *format,...)
Printf style construction of std::string.
HistoryIterator historyEnd() const
Iterator pointing behind the last message.
Base class for Exception.
std::string asUserHistory() const
A single (multiline) string composed of asUserString and historyAsString.
Keep FILE, FUNCTION and LINE.
std::string strerror(int errno_r)
Return string describing the error_r code.
std::string asUserString() const
Translated error message as string suitable for the user.