Mercurial > dive4elements > river
changeset 5932:c7951390fd58
Importer: Log an error if parsing a STA file failed.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 08 May 2013 17:52:54 +0200 |
parents | 5de1b9faebf5 |
children | 1b939742629e f944cc25484c |
files | backend/src/main/java/org/dive4elements/river/importer/ImportGauge.java |
diffstat | 1 files changed, 18 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/ImportGauge.java Wed May 08 17:12:48 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportGauge.java Wed May 08 17:52:54 2013 +0200 @@ -163,7 +163,9 @@ public void parseDependencies() throws IOException { StaFileParser sfp = new StaFileParser(); - sfp.parse(this); + if (!sfp.parse(this)) { + log.error("Parsing STA file failed."); + } AtFileParser afp = new AtFileParser(); setDischargeTable(afp.parse(getAtFile())); @@ -223,19 +225,25 @@ Gauge gauge = getPeer(river); - log.info("store main value types"); - for (ImportMainValueType mainValueType: mainValueTypes) { - mainValueType.getPeer(); + if (mainValueTypes != null) { + log.info("store main value types"); + for (ImportMainValueType mainValueType: mainValueTypes) { + mainValueType.getPeer(); + } } - log.info("store named main values"); - for (ImportNamedMainValue namedMainValue: namedMainValues) { - namedMainValue.getPeer(); + if (namedMainValues != null) { + log.info("store named main values"); + for (ImportNamedMainValue namedMainValue: namedMainValues) { + namedMainValue.getPeer(); + } } - log.info("store main values"); - for (ImportMainValue mainValue: mainValues) { - mainValue.getPeer(river); + if (mainValues != null) { + log.info("store main values"); + for (ImportMainValue mainValue: mainValues) { + mainValue.getPeer(river); + } } storeDischargeTable(gauge);