Skip to content

Commit

Permalink
Merge pull request #1718 from SavinduDimal/fault-seq-err-code-and-mes…
Browse files Browse the repository at this point in the history
…sage

Add error code and error message
  • Loading branch information
SavinduDimal committed Jul 1, 2024
2 parents c96d4f8 + 6e38cc1 commit 66f5619
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ private void invokeFaultSequenceUponError(int statusCode, String reasonText) thr
MessageContext synCtx = getSynapseMessageContext(tenantDomain);
synCtx.setProperty(InboundWebsocketConstants.WEB_SOCKET_CLOSE_CODE, statusCode);
synCtx.setProperty(InboundWebsocketConstants.WEB_SOCKET_REASON_TEXT, reasonText);
synCtx.setProperty(WebsocketConstants.ERROR_CODE, statusCode);
synCtx.setProperty(WebsocketConstants.ERROR_MESSAGE, reasonText);
synCtx.setProperty(InboundWebsocketConstants.FAULT_SEQUENCE_INVOKED_ON_WEBSOCKET_CLIENT_HANDLER_ERROR, true);
getFaultSequence(synCtx, dispatchErrorSequence).mediate(synCtx);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,6 @@ public class WebsocketConstants {
public static final String WS_CLOSE_DEFAULT_REASON_TEXT = "Websocket server terminated";

public static final int WEBSOCKET_UPSTREAM_ERROR_SC = 1014;
public static final String ERROR_CODE = "ERROR_CODE";
public static final String ERROR_MESSAGE = "ERROR_MESSAGE";
}

0 comments on commit 66f5619

Please sign in to comment.