# HG changeset patch # User Tim Englich # Date 1269004559 0 # Node ID 707e142e7d4444b21fe22189893aba5e8278a468 # Parent 0d23f7ba53dd7e8b507a20437189666de7011ea3 Improved ExceptionHandling during WMS-Publishing. gnv/trunk@807 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 0d23f7ba53dd -r 707e142e7d44 gnv/ChangeLog --- a/gnv/ChangeLog Fri Mar 19 12:42:08 2010 +0000 +++ b/gnv/ChangeLog Fri Mar 19 13:15:59 2010 +0000 @@ -1,3 +1,13 @@ +2010-03-19 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (publishWMS), + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (publishWMS), + src/main/java/de/intevation/gnv/action/WMSAction.java (execute): + Improved ExceptionHandling during WMS-Publishing. + The responsedocument will be scanned for Exceptionreports. + Also if no URL, Mapfile or Layer was retrieved from the Responsedocument + the Exceptionpage will be visualized instead an corrupt Openlayersclient. + 2010-03-19 Tim Englich * src/main/resources/applicationMessages.properties: diff -r 0d23f7ba53dd -r 707e142e7d44 gnv/src/main/java/de/intevation/gnv/action/WMSAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java Fri Mar 19 12:42:08 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java Fri Mar 19 13:15:59 2010 +0000 @@ -11,7 +11,6 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; - import org.w3c.dom.Document; import de.intevation.gnv.action.sessionmodel.DiagrammOptions; @@ -121,8 +120,13 @@ request.setAttribute("mapserver", mapserverPath); request.setAttribute("mapfile", mapfilePath); request.setAttribute("layer", layer); - - return super.execute(mapping, form, request, response); + if (mapserverPath != null && + mapfilePath != null && + layer != null){ + return super.execute(mapping, form, request, response); + }else{ + return super.getExceptionForward(mapping); + } } catch (Exception e) { logger.error(e, e); diff -r 0d23f7ba53dd -r 707e142e7d44 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Fri Mar 19 12:42:08 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Fri Mar 19 13:15:59 2010 +0000 @@ -131,7 +131,7 @@ ArtifactObject factory, ArtifactObject artifact, Collection inputParameter - ); + )throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; /** diff -r 0d23f7ba53dd -r 707e142e7d44 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Fri Mar 19 12:42:08 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Fri Mar 19 13:15:59 2010 +0000 @@ -837,7 +837,7 @@ ArtifactObject factory, ArtifactObject artifact, Collection inputParameter - ) { + ) throws ArtifactDatabaseClientException, ArtifactDatabaseInputException{ log.debug("Start wms publishing..."); String target = "wms"; @@ -847,12 +847,12 @@ try { InputStream input = doPostRequest(requestURL, request); Document result = XMLUtils.readDocument(input); - + this.check4ExceptionReport(result); return result; } catch (IOException ioe) { log.error(ioe, ioe); - return null; + throw new ArtifactDatabaseClientException(ioe); } }