You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ge...@apache.org on 2008/10/06 18:35:24 UTC
svn commit: r702199 -
/servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
Author: gertv
Date: Mon Oct 6 09:35:24 2008
New Revision: 702199
URL: http://svn.apache.org/viewvc?rev=702199&view=rev
Log:
SM-1605: File poller endpoint should not throw exception when receiving ERROR Exchange
Modified:
servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
Modified: servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java?rev=702199&r1=702198&r2=702199&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java (original)
+++ servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java Mon Oct 6 09:35:24 2008
@@ -372,12 +372,15 @@
}
}
}
- } else {
+ } else if (exchange.getStatus() == ExchangeStatus.ERROR) {
Exception e = exchange.getError();
if (e == null) {
- e = new JBIException("Unkown error");
+ throw new JBIException("Received an exchange with status ERROR, but no exception was set");
}
- throw e;
+ logger.warn("Message in file " + aFile + " could not be handled successfully: " + e.getMessage(), e);
+ } else {
+ //we should never get an ACTIVE exchange -- the File poller only sends InOnly exchanges
+ throw new JBIException("Unexpectedly received an exchange with status ACTIVE");
}
} finally {
// remove the open exchange