Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java @ 230:6de435235927
Added error messages that are displayed during the feed operation.
flys-client/trunk@1720 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 18 Apr 2011 13:27:49 +0000 |
parents | 924da6695800 |
children | ab8eb2f544f2 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java Thu Apr 14 07:53:01 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java Mon Apr 18 13:27:49 2011 +0000 @@ -32,6 +32,9 @@ /** XPath that points to the result type of a feed or advance operation.*/ public static final String XPATH_RESULT = "/art:result/@art:type"; + /** XPath that points to the result type of a feed or advance operation.*/ + public static final String XPATH_RESULT_MSG = "/art:result/text()"; + /** A constant that marks errors.*/ public static final String OPERATION_FAILURE = "FAILURE"; @@ -101,8 +104,6 @@ artifact.getHash(), createKVP(data)); - XMLDebug.out(feed); - HttpClient client = new HttpClientImpl(url, locale); try { @@ -128,7 +129,11 @@ return (Artifact) new FLYSArtifactCreator().create(description); } else if (result != null && result.equals(OPERATION_FAILURE)) { - throw new ServerException(ERROR_FEED_DATA); + String msg = XMLUtils.xpathString( + description, + XPATH_RESULT_MSG, + ArtifactNamespaceContext.INSTANCE); + throw new ServerException(msg); } } catch (ConnectionException ce) {