From bba7c3d0a94d5c8f403913845be0e6cf32b54308 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Mon, 29 Sep 2008 01:28:13 -0600 Subject: [PATCH] Catch std::exception to catch more printable exceptions. TextException is not an std::exception [child]. Rethrow exceptions caught in main() to minimize catching side-effects. May need more work. --- src/main.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main.cc b/src/main.cc index 38e08fe333..830667e039 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1109,14 +1109,15 @@ SquidMainSafe(int argc, char **argv) try { return SquidMain(argc, argv); } - catch (const TextException &e) { - // XXX: add TextException::print - std::cerr << "dying from unhandled exception: " << e.message << std::endl; + catch (const std::exception &e) { + std::cerr << "dying from an unhandled exception: " << e.what() << std::endl; + throw; } catch (...) { - std::cerr << "dying from unhandled exception." << std::endl; + std::cerr << "dying from an unhandled exception." << std::endl; + throw; } - return -1; + return -1; // not reached } static int -- 2.47.2