Skip to content

Commit

Permalink
Merge pull request #2112 from GDLMadushanka/errorcode
Browse files Browse the repository at this point in the history
Introduce base error code and protocol state
  • Loading branch information
GDLMadushanka authored Nov 2, 2023
2 parents edfc74f + 990ff6d commit eeb813f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public void handleFault(MessageContext synCtx, Exception e) {
if (traceOrDebugOn) {
traceOrDebugWarn(traceOn, "ERROR_CODE : " +
synCtx.getProperty(SynapseConstants.ERROR_CODE));
traceOrDebugWarn(traceOn,"BASE_ERROR_CODE : " +
synCtx.getProperty(SynapseConstants.BASE_ERROR_CODE));
traceOrDebugWarn(traceOn,"PROTOCOL_STATE_ON_FAILURE : " +
synCtx.getProperty(SynapseConstants.PROTOCOL_STATE_ON_FAILURE));
traceOrDebugWarn(traceOn, "ERROR_MESSAGE : " +
synCtx.getProperty(SynapseConstants.ERROR_MESSAGE));
traceOrDebugWarn(traceOn, "ERROR_DETAIL : " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ public static final class Axis2Param {
public static final String SENDING_FAULT = "SENDING_FAULT";
/** The message context property name which holds the error code for the last encountered exception */
public static final String ERROR_CODE = "ERROR_CODE";
/** The message context property name which holds the error code for the last encountered exception
* without any protocol state specific alterations*/
public static final String BASE_ERROR_CODE = "BASE_ERROR_CODE";
/** The message context property name which holds the http protocol state upon a failure*/
public static final String PROTOCOL_STATE_ON_FAILURE = "PROTOCOL_STATE_ON_FAILURE";
/** The MC property name which holds the error message for the last encountered exception */
public static final String ERROR_MESSAGE = "ERROR_MESSAGE";
/** The message context property name which holds the error detail (stack trace) for the last encountered exception */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ private void handleMessage(String messageID ,MessageContext response,
synapseOutMsgCtx.setProperty(SynapseConstants.SENDING_FAULT, Boolean.TRUE);
synapseOutMsgCtx.setProperty(SynapseConstants.ERROR_CODE,
response.getProperty(SynapseConstants.ERROR_CODE));
synapseOutMsgCtx.setProperty(SynapseConstants.BASE_ERROR_CODE,
response.getProperty(SynapseConstants.BASE_ERROR_CODE));
synapseOutMsgCtx.setProperty(SynapseConstants.PROTOCOL_STATE_ON_FAILURE,
response.getProperty(SynapseConstants.PROTOCOL_STATE_ON_FAILURE));
synapseOutMsgCtx.setProperty(SynapseConstants.ERROR_MESSAGE,
response.getProperty(SynapseConstants.ERROR_MESSAGE));
synapseOutMsgCtx.setProperty(SynapseConstants.ERROR_DETAIL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public class PassThroughConstants {
public static final String SENDING_FAULT = "SENDING_FAULT";
/** The message context property name which holds the error code for the last encountered exception */
public static final String ERROR_CODE = "ERROR_CODE";
/** The message context property name which holds the error code for the last encountered exception
* without any protocol state specific alterations*/
public static final String BASE_ERROR_CODE = "BASE_ERROR_CODE";
/** The message context property name which holds the http protocol state upon a failure*/
public static final String PROTOCOL_STATE_ON_FAILURE = "PROTOCOL_STATE_ON_FAILURE";
/** The MC property name which holds the error message for the last encountered exception */
public static final String ERROR_MESSAGE = "ERROR_MESSAGE";
/** The message context property name which holds the error detail (stack trace) for the last encountered exception */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ public void run() {
if (errorCode != -1) {
faultMessageContext.setProperty(
PassThroughConstants.ERROR_CODE, getErrorCode(errorCode, state));
faultMessageContext.setProperty(
PassThroughConstants.BASE_ERROR_CODE, errorCode);
faultMessageContext.setProperty(
PassThroughConstants.PROTOCOL_STATE_ON_FAILURE, state.ordinal());
}
if (exceptionToRaise != null) {
faultMessageContext.setProperty(
Expand Down

0 comments on commit eeb813f

Please sign in to comment.