hi all, I am using camel for http proxy , such as :
use proxy url FROM http://127.0.0.1:8199/test?chunked=false TO http://192.7.0.54:8081/?bridgeEndpoint=true In debug stage , so ,I shutdown the server's port : 192.7.0.54:8081 . If I visit url http://127.0.0.1:8199/test?chunked=false , the exception directly output on screen . How can I catch this exception , and with my replace to a more friendly message instead ? org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused Jun 04, 2015 9:34:50 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry ERROR org.apache.camel.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-acsdev9-60320-1433381616150-0-2 on ExchangeId: ID-acsdev9-60320-1433381616150-0-1). Exhausted after delivery attempt: 1 caught: java.net.ConnectException: Connection refused Message History --------------------------------------------------------------------------------------------------------------------------------------- RouteId ProcessorId Processor Elapsed (ms) [ProxyRepo ] [ProxyRepo ] [http://127.0.0.1:8199/test?chunked=false ] [ 45] [ProxyRepo ] [to1 ] [http://172.27.0.54:8081/?bridgeEndpoint=true ] [ 42] Exchange ----------------------------------------------- Exchange[ Id ID-acsdev9-60320-1433381616150-0-1 ExchangePattern InOut Headers {Accept=text/html,... ... ... , CamelHttpServletResponse=HTTP/1.1 200 } BodyType null Body [Body is null] ] Stacktrace --------------------------------------------------------------------------------------------------------------------------------------- java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) -- View this message in context: http://camel.465427.n5.nabble.com/How-to-avoid-direct-error-message-or-exception-print-out-put-on-screen-tp5767850.html Sent from the Camel - Users mailing list archive at Nabble.com.