From 5ab0f0190d93759368d2f6e4553a8da2644bc638 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 22 Aug 2019 10:54:20 +1000 Subject: OhSillyThreatLevels should throw an exception when not allowed. --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 64da67e..544dce4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -212,9 +212,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api internal void OSSLError(string msg) { if (m_debuggerSafe) - { OSSLShoutError(msg); - } else { throw new ScriptException("OSSL Runtime Error: " + msg); @@ -258,20 +256,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void CheckThreatLevel() { if (!m_OSFunctionsEnabled) - OSSLError(String.Format("{0} permission denied. All OS functions are disabled.")); // throws + throw new ScriptException(String.Format("{0} permission denied. All OS functions are disabled.")); } // Returns if the function is allowed. Throws a script exception if not allowed. public void CheckThreatLevel(ThreatLevel level, string function) { if (!m_OSFunctionsEnabled) - OSSLError(String.Format("{0} permission denied. All OS functions are disabled.", function)); // throws + throw new ScriptException(String.Format("{0} permission denied. All OS functions are disabled.", function)); string reasonWhyNot = CheckThreatLevelTest(level, function); if (!String.IsNullOrEmpty(reasonWhyNot)) - { - OSSLError(reasonWhyNot); - } + throw new ScriptException(reasonWhyNot); } // Check to see if function is allowed. Returns an empty string if function permitted -- cgit v1.1