From a66c43d45094833cbb3443ce660e15dde02b7b20 Mon Sep 17 00:00:00 2001
From: Sean Dague
Date: Tue, 22 Apr 2008 19:44:40 +0000
Subject: From: Dr Scofield <hud@zurich.ibm.com>

some exceptional code ;-) i've added TerrainException and have modified
TerrainModule to now throw TerrainExceptions.

   cheers,
   dr scofield



---
 OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs
index 40d4771..dc8a023 100644
--- a/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs
@@ -179,14 +179,13 @@ namespace OpenSim.Region.Environment.Modules.Terrain
                         {
                             m_log.Error("[TERRAIN]: Unable to load heightmap, the " + loader.Value +
                                         " parser does not support file loading. (May be save only)");
-                            throw new Exception(String.Format("unable to load heightmap: parser {0} does not support loading", loader.Value));
+                            throw new TerrainException(String.Format("unable to load heightmap: parser {0} does not support loading", loader.Value));
                         }
                         catch (FileNotFoundException)
                         {
                             m_log.Error(
                                 "[TERRAIN]: Unable to load heightmap, file not found. (A directory permissions error may also cause this)");
-                            throw new Exception(String.Format("unable to load heightmap: file {0} not found (or permissions do not allow access",
-                                                              filename));
+                            throw new TerrainException(String.Format("unable to load heightmap: file {0} not found (or permissions do not allow access", filename));
                         }
                     }
                     CheckForTerrainUpdates();
@@ -195,8 +194,7 @@ namespace OpenSim.Region.Environment.Modules.Terrain
                 }
             }
             m_log.Error("[TERRAIN]: Unable to load heightmap, no file loader availible for that format.");
-            throw new Exception(String.Format("unable to load heightmap from file {0}: no loader available for that format",
-                                              filename));
+            throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename));
         }
 
         /// <summary>
@@ -219,7 +217,7 @@ namespace OpenSim.Region.Environment.Modules.Terrain
             catch (NotImplementedException)
             {
                 m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented.");
-                throw new Exception(String.Format("unable to save heightmap: {0}: saving of this file format not implemented"));
+                throw new TerrainException(String.Format("unable to save heightmap: {0}: saving of this file format not implemented"));
             }
         }
 
-- 
cgit v1.1