Error code not available when rsocket connection establishment fails
akulkarni-01 opened this issue · comments
@akulkarni-01
In general, you should be able to observe initial connection setup termination via the following API
client.connect()
.then(rsocket => {
// do on connected
}, error => {
// do on failure
console.error(error)
});
But, what you mentioned is something different. I believe that it is not always possible to get error or full error info due to the browser websocket API limitations and in general websocket API limitations https://stackoverflow.com/a/18804298/4891253
Thanks @OlegDokuka
So if I am understanding it correctly it is a current limitation of the ws library that rsocket JS uses .
If that correct ?
Line 74 in f85762d
@akulkarni-01 we use a standard websocket api available at all the browsers. Behaviors may differ depends on the browser implementation
@akulkarni-01 for more information on the browser websocket specification please use the following link -> https://html.spec.whatwg.org/multipage/web-sockets.html#the-websocket-interface. According to the spec, the onerror event handler propagates an error as ErrorEvent
. And according to the spec, fields like message
or error
may or may not be set. Hence, we can nothing to do with that and the behavior depends on the particular browser implementation. We do not use any external libraries for the websocket-client-transport (used for the browser side) and only for nodejs side websocket-server-transport relies on the Node WebSocket library.
Also, please see -> https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/error_event