From d9aaf51561ea7bb2ee030c648611a5281f21ec49 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 25 Oct 2012 02:52:20 +0100 Subject: When scripts generate expected exceptions (e.g. due to checked bad parameter) throw ScriptException instead of just a plain old exception. This is to make it easier to distinguish these exceptions from unexpected OpenSimulator problems internally and in regression tests. No functional changes. --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++-- .../Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | 10 +++++----- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index cf801ba..dc791d3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -10685,12 +10685,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api internal void Deprecated(string command) { - throw new Exception("Command deprecated: " + command); + throw new ScriptException("Command deprecated: " + command); } internal void LSLError(string msg) { - throw new Exception("LSL Runtime Error: " + msg); + throw new ScriptException("LSL Runtime Error: " + msg); } public delegate void AssetRequestCallback(UUID assetID, AssetBase asset); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs index 6809c09..a830a15 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs @@ -95,13 +95,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api internal void MODError(string msg) { - throw new Exception("MOD Runtime Error: " + msg); + throw new ScriptException("MOD Runtime Error: " + msg); } - // - //Dumps an error message on the debug console. - // - + /// + /// Dumps an error message on the debug console. + /// + /// internal void MODShoutError(string message) { if (message.Length > 1023) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 804b0af..5301ccd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -210,7 +210,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api internal void OSSLError(string msg) { - throw new Exception("OSSL Runtime Error: " + msg); + throw new ScriptException("OSSL Runtime Error: " + msg); } /// -- cgit v1.1