Hi,
It appears that when a channel receives an error, the error object passed to listeners does not include the full payload returned by the server.
Setup:
const client = new DXLinkWebSocketClient({})
client.setAuthToken('token')
client.connect('url')
const channel = client.openChannel('SERVICE', {})
channel.addErrorListener((error) => console.log(error))
// send invalid message
channel.addStateChangeListener((state) => {
if (state === DXLinkChannelState.OPENED) {
channel.send({
type: 'MESSAGE_TYPE',
channel: channel.id,
invalidField: 'invalid'
})
}
})
Observed behavior:
The error received in the listener is:
{ "type": "INVALID_MESSAGE", "message": "Some text" }
Expected behavior:
The full error payload returned by the server should be exposed to the listener, for example:
{
"type": "ERROR",
"channel": 1,
"error": "INVALID_MESSAGE",
"message": "Some text",
"correlationId": "228"
}
The additional fields are important for proper error handling.
Thanks!
Hi,
It appears that when a channel receives an error, the error object passed to listeners does not include the full payload returned by the server.
Setup:
Observed behavior:
The error received in the listener is:
{ "type": "INVALID_MESSAGE", "message": "Some text" }Expected behavior:
The full error payload returned by the server should be exposed to the listener, for example:
{ "type": "ERROR", "channel": 1, "error": "INVALID_MESSAGE", "message": "Some text", "correlationId": "228" }The additional fields are important for proper error handling.
Thanks!