]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Catch std::exception to catch more printable exceptions. TextException is
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 29 Sep 2008 07:28:13 +0000 (01:28 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 29 Sep 2008 07:28:13 +0000 (01:28 -0600)
not an std::exception [child].

Rethrow exceptions caught in main() to minimize catching side-effects. May
need more work.

src/main.cc

index 38e08fe333eea262e8f0cd2bd91ba036e30b2cab..830667e039491e80f846b9ced334a8ee9fa776f0 100644 (file)
@@ -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