-
Notifications
You must be signed in to change notification settings - Fork 22
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
Error improvements #3372
Comments
The 3 places where serialization has to occur is: 1) messenger API, 2) IDB, 3) Redux store |
Yes, but they should not leave those areas IMHO. If an error is received by those three, they should immediately deserialize it before calling external functions, although I haven't looked into where this could happen exactly in RTK. The messenger for example does this internally for thrown errors; for passed errors (like for pixiebrix-extension/src/background/logging.ts Lines 263 to 274 in 954e989
|
RTK is just a nice toolkit for Redux. What's happening is that the error is getting serialized before it's placed in the store Then, in our components we use hooks, e.g.,
Option 2 is a non-starter -- it's too tedious/error-prone. Option 1 could make sense in the future With respect to IDB, we could deserialize upon retrieval from IDB. However, there's some places where we store the errors in Redux. So we'd need to serialize before putting it into the Redux store there and then deserialize All in all, our codebase really wants everything to be serializable 😄 . I think we're fighting an uphill battle against wanting to rely on classnames/prototypes/instanceof |
Co-authored-by: Todd Schiller <todd.schiller@gmail.com>
This issue will be closed in 7 days unless the stale label is removed, or a comment is added to the issue. |
This issue was closed because it has been stale for 7 days with no activity. |
- utils/errors/businessErrors.ts
- utils/errors/clientRequestErrors.ts
- utils/errors/generic.ts
- utils/errors/errorHelpers.ts
selectErrorFromEvent
/selectErrorFromRejectionEvent
out ofselectError
NetworkErrorDetail
/enrichBusinessRequestError
duplicationselectNetworkErrorMessage
into enrichBusinessRequestError so that AxiosError never makes it out out the latterrejectOnCancelled
with an inline cancellation mechanismFollows
Error#cause
, even outsideContextError
#3073The text was updated successfully, but these errors were encountered: