-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use serialize-error
module (Error#cause
support)
#2392
Comments
Honestly, this is working exactly as intended here.
So in the end: you should probably handle those errors and use |
It'd be easy enough to add another field to the known list, but yeah, I don't want to add another dep here. |
Going to close this for now - I don't think this is urgent enough for us to change. |
I'd also like to see Or possibly provide a way to override |
@kasparkallas that hasn't come up yet. If you'd like to make a PR in that direction, we'd be interested. |
A. Make it possible to override Interested in both? Here are some references to evaluate the urgency of B:
|
Ping! @phryneas @markerikson |
Honestly, at this point only interested in B - A would probably make the types explode. |
I noticed that RTK’s error serialization is rather simple:
redux-toolkit/packages/toolkit/src/createAsyncThunk.ts
Lines 94 to 107 in 64a30d8
For example this does not support nested errors, like the new
cause
property: https://v8.dev/features/error-causeI know RTK supports specifying a custom
serializeError
as an option, but it'd be great to support thecause
property out of the box, perhaps using an existing solution for error serialization:The text was updated successfully, but these errors were encountered: