diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-26 22:38:57 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-26 22:38:57 +0000 |
commit | 6dd8d6a5652b2301a65f97dee17b5b0b9cfb038b (patch) | |
tree | a0e7039a9fe0b80bfc94443b6b87a8456811a853 /branches/sca-java-1.5.1/modules/assembly-xml | |
parent | 1558298f64038d66ab07b6d2d062aa8473d6bc48 (diff) |
Fix TUSCANY-3172 (domain manager doesn't report errors cleanly to the nodes)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@797997 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5.1/modules/assembly-xml')
2 files changed, 15 insertions, 5 deletions
diff --git a/branches/sca-java-1.5.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java b/branches/sca-java-1.5.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java index b8e5330007..6abc28adde 100644 --- a/branches/sca-java-1.5.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java +++ b/branches/sca-java-1.5.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java @@ -23,6 +23,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.net.HttpURLConnection; import java.net.URI; import java.net.URL; import java.net.URLConnection; @@ -119,10 +120,18 @@ public class CompositeDocumentProcessor extends BaseAssemblyProcessor implements try { URLConnection connection = url.openConnection(); connection.setUseCaches(false); - scdlStream = connection.getInputStream(); + try { + scdlStream = connection.getInputStream(); + } catch (IOException e) { + if (e.getClass() == IOException.class && connection instanceof HttpURLConnection + && ((HttpURLConnection)connection).getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) { + error("HttpServerError", url, ((HttpURLConnection)connection).getResponseMessage()); + } + throw e; + } } catch (IOException e) { ContributionReadException ce = new ContributionReadException(e); - error("ContributionReadException", url, ce); + error("ContributionReadException", url, e); throw ce; } return read(uri, scdlStream); @@ -161,11 +170,11 @@ public class CompositeDocumentProcessor extends BaseAssemblyProcessor implements } } catch ( IOException e ) { ContributionReadException ce = new ContributionReadException(e); - error("ContributionReadException", scdlStream, ce); + error("ContributionReadException", scdlStream, e); throw ce; } catch ( Exception e ) { ContributionReadException ce = new ContributionReadException(e); - error("ContributionReadException", scdlStream, ce); + error("ContributionReadException", scdlStream, e); //throw ce; } @@ -203,7 +212,7 @@ public class CompositeDocumentProcessor extends BaseAssemblyProcessor implements } catch (XMLStreamException e) { ContributionReadException ce = new ContributionReadException(e); - error("ContributionReadException", inputFactory, ce); + error("ContributionReadException", inputFactory, e); throw ce; } finally { try { diff --git a/branches/sca-java-1.5.1/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties b/branches/sca-java-1.5.1/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties index 8cc5e5a5ec..6fd524716c 100644 --- a/branches/sca-java-1.5.1/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties +++ b/branches/sca-java-1.5.1/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties @@ -27,3 +27,4 @@ PolicyServiceValidationException = PolicyValidation exceptions when processing s ContributionReadException = ContributionReadException occured due to : {0} ContributionWriteException = ContributionWriteException occured due to : {0} XMLStreamException = XMLStreamException occured due to : {0} +HttpServerError = HTTP Server Error : {0} |