diff --git a/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ClientWorker.java b/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ClientWorker.java index 6885d085f1..59ee8c2beb 100644 --- a/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ClientWorker.java +++ b/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ClientWorker.java @@ -145,6 +145,8 @@ public ClientWorker(TargetConfiguration targetConfiguration, outMsgCtx.getProperty(PassThroughConstants.PASS_THROUGH_SOURCE_CONFIGURATION)); responseMsgCtx.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_IN_MESSAGES, outMsgCtx.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_IN_MESSAGES)); + responseMsgCtx.setProperty(PassThroughConstants.INTERNAL_EXCEPTION_ORIGIN, + outMsgCtx.getProperty(PassThroughConstants.INTERNAL_EXCEPTION_ORIGIN)); responseMsgCtx.setServerSide(true); responseMsgCtx.setDoingREST(outMsgCtx.isDoingREST()); diff --git a/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java b/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java index f9660b19e0..77252cd796 100644 --- a/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java +++ b/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/TargetHandler.java @@ -387,6 +387,8 @@ public void responseReceived(NHttpClientConnection conn) { // waiting on writing the request out, will get notified. And we will proceed with the response // regardless of the http status code. But mark target and source connections to be closed. informWriterError(conn); + requestMsgContext.setProperty(PassThroughConstants.INTERNAL_EXCEPTION_ORIGIN, + PassThroughConstants.INTERNAL_ORIGIN_ERROR_HANDLER); StatusLine errorStatus = response.getStatusLine(); if (errorStatus != null) { TargetContext.updateState(conn, ProtocolState.REQUEST_DONE);