question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use `serialize-error` module (`Error#cause` support)

See original GitHub issue

I noticed that RTK’s error serialization is rather simple:

https://github.com/reduxjs/redux-toolkit/blob/64a30d83384d77bcbc59231fa32aa2f1acd67020/packages/toolkit/src/createAsyncThunk.ts#L94-L107

For example this does not support nested errors, like the new cause property: https://v8.dev/features/error-cause

I know RTK supports specifying a custom serializeError as an option, but it’d be great to support the cause property out of the box, perhaps using an existing solution for error serialization:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
phryneascommented, Jul 22, 2022

Honestly, at this point only interested in B - A would probably make the types explode.

0reactions
kasparkallascommented, Jul 22, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

serialize-error - npm.io
Error constructors. When a serialized error with a known name is encountered, it will be deserialized using the corresponding error constructor, while unknown ......
Read more >
Top 5 serialize-error Code Examples - Snyk
To help you get started, we've selected a few serialize-error examples, based on popular ways it is used in public projects. Secure your...
Read more >
cause - Npms.io
Light-weight helpers for handling JavaScript Errors in node.js and the browser. Helps with long stack traces, Error subclasses, wrapping internal errors ...
Read more >
Errors | Node.js v19.3.0 Documentation
An attempt was made to use a URL of an incompatible scheme (protocol) for a specific purpose. It is only used in the...
Read more >
unable to use serialize-error package In nodejs - Stack Overflow
This issue was solved by using the old version of this library. I was using its latest version. but its old version working...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found