client-js
client-js copied to clipboard
Can't catch bad response error
When the server response with bad reponse format, how can I catch the error?
client.request({ method: "method" }).then().catch(err){ //can't trigger this }
Actually didn't realize this was from Jan. I missed this in the pipeline we'll have a quick look
Seems at current you'd have to register an event listener for onError
, and handle it there... but it's not catch-able. :thinking:
Actually... I just tried this and... it works. The promise is rejected with the error, but you can also subscribe to events. Might be stale/can't recreate?
See also https://github.com/open-rpc/client-js/issues/306