changeset 306:ea3fde77ea48

Catch generic Exceptions to avoid leaking them and creating silent errors
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 06 Sep 2012 18:56:20 +0200
parents ebf974199309
children f9e53dcc7424
files ChangeLog src/java/de/intevation/mxd/reader/RasterLayerReader.java
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Sep 05 17:19:19 2012 +0200
+++ b/ChangeLog	Thu Sep 06 18:56:20 2012 +0200
@@ -1,3 +1,9 @@
+2012-09-05  Andre Heinecke <aheinecke@intevation.de>
+
+	* src/java/de/intevation/mxd/reader/RasterLayerReader.java:
+	Catch generic Exceptions to avoid leaking exceptions and
+	silent failures
+
 2012-09-05  Andre Heinecke <aheinecke@intevation.de>
 
 	* src/java/de/intevation/mxd/writer/MapScriptWriter.java:
--- a/src/java/de/intevation/mxd/reader/RasterLayerReader.java	Wed Sep 05 17:19:19 2012 +0200
+++ b/src/java/de/intevation/mxd/reader/RasterLayerReader.java	Thu Sep 06 18:56:20 2012 +0200
@@ -101,7 +101,7 @@
         try {
             layerElement.setAttribute("name", layer.getName());
         }
-        catch(IOException ioe) {
+        catch(Exception e) {
             logger.warn(
                 "Could not read layer name." +
                 " Stopped reading layer.");
@@ -120,7 +120,7 @@
             layerElement.setAttribute("max_scale",
                 String.valueOf(layer.getMaximumScale()));
         }
-        catch(IOException ioe) {
+        catch(Exception e) {
             logger.warn(
                 "Could not read maximum scale.");
         }
@@ -133,7 +133,7 @@
                 layerElement.setAttribute("status", "off");
             }
         }
-        catch(IOException ioe) {
+        catch(Exception e) {
             logger.warn(
                 "Could not read layer status." +
                 " Setting layer status to \"on\".");
@@ -142,7 +142,7 @@
         try {
             layerElement.setAttribute("data_source", layer.getFilePath());
         }
-        catch(IOException ioe) {
+        catch(Exception e) {
             logger.warn(
                 "Could not read datasource." +
                 " Stopped reading layer " + layer.getName() + ".");
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)