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
feat(sdk): Decrypt error is StreamrClientError (#2895)
Removed custom `DecryptError` class. Using `StreamrClientError` with
code `DECRYPT_ERROR` instead.
Changed some wording of decrypt errors: encryption keys are no longer
referred as group key, which is an internal term for encryption key (see
e.g. `exports.ts#36`).
## Cause parameter
Considered adding `cause` parameter for `StreamrClientError`
(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause).
Decided not to include it as it we've earlier had compatibility issues
with it when using Firefox. Maybe browser support is nowadays better. We
can add that later if needed.
The `cause` parameter would link root cause `Error` instances to
StreamrClientError and therefore provide very detailed stack traces. For
client errors such stack traces are maybe not needed in practice. I.e.
if `decryptWithAES()` throws an error, we'll create a
`StreamrClientError` with message of "`AES decryption failed`" and type
of `DECRYPT_ERROR`. In most cases these bits of information are
sufficient for analyzing application level issues.
## Future improvements
- convert all other custom errors to `StreamrClientError`
- add `toEqualStreamrError()` test utility
0 commit comments