]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/base/TextException.cc
Detail client closures of CONNECT tunnels during TLS handshake (#691)
[thirdparty/squid.git] / src / base / TextException.cc
index d6d84164e8acb27f9cbc358963317b68a9b3ba93..257ca20f8e9a07572defac7345e50177b65cdd4b 100644 (file)
@@ -58,6 +58,13 @@ TextException::what() const throw()
     return result.what();
 }
 
+std::ostream &
+operator <<(std::ostream &os, const TextException &ex)
+{
+    ex.print(os);
+    return os;
+}
+
 std::ostream &
 CurrentException(std::ostream &os)
 {
@@ -65,6 +72,9 @@ CurrentException(std::ostream &os)
         try {
             throw; // re-throw to recognize the exception type
         }
+        catch (const TextException &ex) {
+            os << ex; // optimization: this is a lot cheaper than what() below
+        }
         catch (const std::exception &ex) {
             os << ex.what();
         }