From e694e1a6576fc0012c48fd363d6d13379d025fe5 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 25 Mar 2009 19:21:28 +0000 Subject: * minor: Adjust exception catching on load/save xml[2]/oar. * Allow non FileNotFoundExceptions to propogate rather than post a misleading error message --- OpenSim/Region/Application/OpenSim.cs | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index d27beff..5e7420b 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -1007,7 +1007,7 @@ namespace OpenSim { m_sceneManager.LoadCurrentSceneFromXml(DEFAULT_PRIM_BACKUP_FILENAME, false, loadOffset); } - catch + catch (FileNotFoundException) { m_console.Error("Default xml not found. Usage: load-xml "); } @@ -1018,14 +1018,7 @@ namespace OpenSim { if (cmdparams.Length > 2) { - try - { - m_sceneManager.SaveCurrentSceneToXml2(cmdparams[2]); - } - catch - { - m_console.Error("Unable to save xml. Usage: save xml2 "); - } + m_sceneManager.SaveCurrentSceneToXml2(cmdparams[2]); } else { @@ -1041,7 +1034,7 @@ namespace OpenSim { m_sceneManager.LoadCurrentSceneFromXml2(cmdparams[2]); } - catch + catch (FileNotFoundException) { m_console.Error("Specified xml not found. Usage: load xml2 "); } @@ -1052,7 +1045,7 @@ namespace OpenSim { m_sceneManager.LoadCurrentSceneFromXml2(DEFAULT_PRIM_BACKUP_FILENAME); } - catch + catch (FileNotFoundException) { m_console.Error("Default xml not found. Usage: load xml2 "); } @@ -1071,7 +1064,7 @@ namespace OpenSim { m_sceneManager.LoadArchiveToCurrentScene(cmdparams[2]); } - catch + catch (FileNotFoundException) { m_console.Error("Specified oar not found. Usage: load oar "); } @@ -1082,7 +1075,7 @@ namespace OpenSim { m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME); } - catch + catch (FileNotFoundException) { m_console.Error("Default oar not found. Usage: load oar "); } @@ -1097,14 +1090,7 @@ namespace OpenSim { if (cmdparams.Length > 2) { - try - { - m_sceneManager.SaveCurrentSceneToArchive(cmdparams[2]); - } - catch - { - m_console.Error("Unable to save oar. Usage: save oar "); - } + m_sceneManager.SaveCurrentSceneToArchive(cmdparams[2]); } else { -- cgit v1.1