changeset 658:ed7c901ee712

If Artifact.feed() fails do not store invalid values in database. flys-artifacts/trunk@2062 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 07 Jun 2011 11:43:30 +0000
parents ac1399d325e9
children ab43f36f4af6
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Jun 06 11:34:44 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Jun 07 11:43:30 2011 +0000
@@ -1,3 +1,8 @@
+2011-06-08  Sascha L. Teichmann <sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java:
+	  If feed() fails do not store invalid values in database.
+
 2011-06-06  Sascha L. Teichmann <sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/InfoGeneratorHelper.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Mon Jun 06 11:34:44 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Tue Jun 07 11:43:30 2011 +0000
@@ -186,6 +186,8 @@
             return describe(target, context);
         }
         catch (IllegalArgumentException iae) {
+            // do not store state if validation fails.
+            context.afterCall(CallContext.NOTHING);
             creator.addAttr(result, "type", OPERATION_FAILED, true);
 
             result.setTextContent(iae.getMessage());

http://dive4elements.wald.intevation.org