void printException(Exception &e, const UString &prefix) { Exception::Stack &stack = e.getStack(); if (stack.empty()) { status("FATAL ERROR"); return; } status("%s%s", prefix.c_str(), stack.top().c_str()); stack.pop(); while (!stack.empty()) { status(" Because: %s", stack.top().c_str()); stack.pop(); } }
void printException(Exception &e, const UString &prefix) { try { Exception::Stack &stack = e.getStack(); if (stack.empty()) { status("FATAL ERROR"); return; } status("%s%s", prefix.c_str(), stack.top().c_str()); stack.pop(); while (!stack.empty()) { status(" Because: %s", stack.top().c_str()); stack.pop(); } } catch (...) { status("FATAL ERROR: Exception while printing exception stack"); std::exit(1); } }