[libcxx-commits] [libcxxabi] ead7a5f - [libc++abi] Reword uncaught exception termination message

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 10 06:58:55 PDT 2022


Author: Louis Dionne
Date: 2022-05-10T09:58:40-04:00
New Revision: ead7a5fc04360c1d740214048b15c4d7100dc768

URL: https://github.com/llvm/llvm-project/commit/ead7a5fc04360c1d740214048b15c4d7100dc768
DIFF: https://github.com/llvm/llvm-project/commit/ead7a5fc04360c1d740214048b15c4d7100dc768.diff

LOG: [libc++abi] Reword uncaught exception termination message

When we terminate due to an exception being uncaught, libc++abi prints
a message saying "terminating with uncaught exception [...]". This patch
changes that to say "terminating due to uncaught exception [...]" instead,
which is a bit clearer. Indeed, I've seen some people being confused and
thinking that libc++abi was the component throwing the exception.

Differential Revision: https://reviews.llvm.org/D125245

Added: 
    

Modified: 
    libcxxabi/src/cxa_default_handlers.cpp

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/cxa_default_handlers.cpp b/libcxxabi/src/cxa_default_handlers.cpp
index b6ce05853c50c..2c42f652db558 100644
--- a/libcxxabi/src/cxa_default_handlers.cpp
+++ b/libcxxabi/src/cxa_default_handlers.cpp
@@ -63,17 +63,17 @@ static void demangling_terminate_handler()
                 {
                     // Include the what() message from the exception
                     const std::exception* e = static_cast<const std::exception*>(thrown_object);
-                    abort_message("terminating with %s exception of type %s: %s",
+                    abort_message("terminating due to %s exception of type %s: %s",
                                   cause, name, e->what());
                 }
                 else
-                    // Else just note that we're terminating with an exception
-                    abort_message("terminating with %s exception of type %s",
+                    // Else just note that we're terminating due to an exception
+                    abort_message("terminating due to %s exception of type %s",
                                    cause, name);
             }
             else
-                // Else we're terminating with a foreign exception
-                abort_message("terminating with %s foreign exception", cause);
+                // Else we're terminating due to a foreign exception
+                abort_message("terminating due to %s foreign exception", cause);
         }
     }
 #endif


        


More information about the libcxx-commits mailing list