From 2f003fd5a99f9b9f42b74a70d3a53e818b9bcee4 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Wed, 13 Jul 2016 14:58:12 -0400
Subject: [PATCH] MAINT-5011: Throw an actual exception in Force Software
 Exception.

http://en.cppreference.com/w/cpp/language/throw says of the plain throw syntax:

"This form is only allowed when an exception is presently being handled (it
calls std::terminate if used otherwise)."

On advice from Oz, replace plain 'throw;' with throwing a std::runtime_error.
---
 indra/newview/llappviewer.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 604e45f3148..a812a5e518b 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -231,6 +231,7 @@
 #include "llcoproceduremanager.h"
 #include "llviewereventrecorder.h"
 
+#include <stdexcept>
 
 // *FIX: These extern globals should be cleaned up.
 // The globals either represent state/config/resource-storage of either 
@@ -5512,8 +5513,7 @@ void LLAppViewer::forceErrorInfiniteLoop()
 void LLAppViewer::forceErrorSoftwareException()
 {
    	LL_WARNS() << "Forcing a deliberate exception" << LL_ENDL;
-    // *FIX: Any way to insure it won't be handled?
-    throw; 
+    throw std::runtime_error("User selected Force Software Exception");
 }
 
 void LLAppViewer::forceErrorDriverCrash()
-- 
GitLab