Conversation
src/utils/Logger.ts
Outdated
| * https://stackoverflow.com/questions/69789058/what-does-this-error-mean-in-redux-toolkit | ||
| * https://redux-toolkit.js.org/api/createAsyncThunk#options | ||
| */ | ||
| if (messages?.[0]?.error?.name === 'ConditionError') { |
There was a problem hiding this comment.
Just in case, I've ran a check in node_modules to ensure no other dependency is throwing ConditionError. The only library using is is Redux Toolkit and the only place where this particular error is thrown is in the only place in their codebase that I've linked there in the comment (first link).
So it is safe to assume that suppressing this error will not suppress any errors that we do not want to suppress.
There was a problem hiding this comment.
What do you think of doing this in the logger saga instead?
https://github.com/valora-inc/wallet/blob/34a9d389b63ed0b79cc6bbe53d4706662f6a2e20/src/redux/sagas.ts#L77-L101
This way it's more targeted. And the logger doesn't need to know about it.
There was a problem hiding this comment.
@jeanregisser I think it makes sense, will do!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6213 +/- ##
==========================================
- Coverage 88.93% 88.92% -0.01%
==========================================
Files 737 737
Lines 31370 31381 +11
Branches 5796 5805 +9
==========================================
+ Hits 27898 27906 +8
- Misses 3274 3431 +157
+ Partials 198 44 -154
... and 69 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Description
This is not an actual error but rather a way for Redux Toolkit to signal that a thunk condition (most likely caused by RTK-Query) has evaluated to false and cancelled the thunk execution OR the thunk execution was aborted. As can be seen from the Redux Toolkit code – this is not an actual
Errorclass instance but just a way of signalling the failed conditionnecessary to execute the thunk.
For more context, please check out the following links:
https://stackoverflow.com/questions/69789058/what-does-this-error-mean-in-redux-toolkit
https://redux-toolkit.js.org/api/createAsyncThunk#options
Test plan
N/A
Related issues
N/A
Backwards compatibility
Yes
Network scalability
If a new NetworkId and/or Network are added in the future, the changes in this PR will: