Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce base error code and protocol state #2112

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading