Mercurial > mxd2map
diff src/java/de/intevation/mxd/reader/MultiLayerFillSymbolReader.java @ 115:fb93f20478cc
Improved exception handling for symbol reader.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 15 Jun 2011 16:48:42 +0200 |
parents | 59e06c405a9a |
children | 0bde090506f9 |
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/MultiLayerFillSymbolReader.java Wed Jun 15 16:13:32 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MultiLayerFillSymbolReader.java Wed Jun 15 16:48:42 2011 +0200 @@ -55,23 +55,29 @@ * * @return The XML node. */ - public Element read() - throws Exception { + public Element read() { logger.debug("read()"); - for(int i = 0; i < symbol.getLayerCount(); i++) { - ISymbol sym = (ISymbol)symbol.getLayer(i); + try { + for(int i = 0; i < symbol.getLayerCount(); i++) { + ISymbol sym = (ISymbol)symbol.getLayer(i); - FillSymbolReader fsr = new FillSymbolReader(); - if(fsr.canRead(sym)) { - fsr.setSymbol(sym); - fsr.setParent(parent); - fsr.setUtil(util); - fsr.read(); + FillSymbolReader fsr = new FillSymbolReader(); + if(fsr.canRead(sym)) { + fsr.setSymbol(sym); + fsr.setParent(parent); + fsr.setUtil(util); + fsr.read(); + } + else { + logger.debug("The type of " + sym.getClass().toString() + + " is not implemented!"); + } } - else { - logger.debug("The type of " + sym.getClass().toString() + - " is not implemented!"); - } + } + catch(Exception e) { + logger.error( + "Could not read the symbol " + + symbol.getClass().toString()); } return parent; }