You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow passing a cause to predefined error functions (#83)
* Allow passing a cause to predefined error functions
This allows passing an `Error` class object to one of the predefined error functions as defined in `rpcErrors` and `providerErrors`. Upon calling the `serialise` function of the `JsonRpcError` class, the cause error will be serialised using the `serializeCause` function.
* Add tests to ensure error.serialize().data is not an instance of Error
The expect function ensures that the type of error.serialize().data is an object and contains specific serialized data while ensuring it does not contain an error instance. This test is necessary to avoid unexpected errors during exception handling.
* Apply suggestions from code review
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
* Export `serializeCause` and `DataWithOptionalCause`
* Fix type errors
* Update coverage tresholds
---------
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
0 commit comments