js-sdk icon indicating copy to clipboard operation
js-sdk copied to clipboard

Inconsistent error handling between communication protocol for state management

Open SoTrx opened this issue 1 year ago • 3 comments

Expected Behavior

Whether you use HTTP or gRPC shouldn't matter for coding.

Actual Behavior

The save() method in the gRPC implementation throws an exception on failure, which is great However, the same save() method in the HTTP implementation returns an object containing an error without actually throwing an exception.

Steps to Reproduce the Problem

You can see this in the code itself

Re-trowing the error in the HTTP implementation should fix this, and perhaps using the cause attribute on top of that to chain errors would also help with debugging.

I can help with this if needed.

SoTrx avatar Apr 25 '23 16:04 SoTrx