[MXD2map-commits] r306:ea3fde77ea48

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Sep 6 18:59:38 CEST 2012


details:   http://hg.intevation.org/geospatial/mxd2map/rev/ea3fde77ea48

changeset: 306:ea3fde77ea48

user:      Andre Heinecke <aheinecke at intevation.de>

date:      Thu Sep 06 18:56:20 2012 +0200

description:
Catch generic Exceptions to avoid leaking them and creating
silent errors


diffstat:

 ChangeLog                                                |  6 ++++++
 src/java/de/intevation/mxd/reader/RasterLayerReader.java |  8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r ebf974199309 -r ea3fde77ea48 ChangeLog
--- 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 at 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 at intevation.de>
 
 	* src/java/de/intevation/mxd/writer/MapScriptWriter.java:
diff -r ebf974199309 -r ea3fde77ea48 src/java/de/intevation/mxd/reader/RasterLayerReader.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() + ".");


More information about the MXD2map-commits mailing list