-
Notifications
You must be signed in to change notification settings - Fork 25
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
RTK errors lose cause
(the page editor HTTP error log is broken)
#3613
Comments
I bisected the cause back to this: I'm guessing it's because I opened an issue upstream, but I think we should still use the custom |
cause
(the page editor HTTP error log is broken)cause
(the page editor HTTP error log is broken)
Not sure if I'm understanding, but the network errors are serialized here: pixiebrix-extension/src/services/api.ts Line 97 in 37d8b1b
It's using the serializeError method from |
The HTTP error log show bricks errors, which aren't calls made via RTK Query. They would be made through the background worker's proxyService method with Axios The serialization would happen at either: 1) the messenger boundary, and/or 2) storing the error in IDB with recordLog, 3) when the log record is read from IDB and placed in the Redux Slice (which we use RTK to write) In cases 1/2, I would imagine any non-enumerable/serialized props would get dropped. For 3, Redux puts whatever you throw at it in the Redux Store, but has middleware that will show a warning. My hunch is it's probably No 2. not accounting for it right now. IDB contents currently: |
Something (presumably RTK) is only partially serializing errors, not
serialize-errors
. This is an example I'm seeing in the page editor:The error is thrown when I try to expand this, which then crashes the app because it expects
cause
:The only place where we generate a RemoteServiceError has a
cause
:pixiebrix-extension/src/utils/enrichAxiosErrors.ts
Line 67 in e1c4679
Possible solution
RTK appears to expose a
serializeError
option but I didn't immediately find a way to implement this in our codebase.Related
Recently we've encountered errors that somehow lacked a
cause
property. Maybe around this time, but I'm not sure:Found while looking into:
This worked three months ago:
RTK docs:
The text was updated successfully, but these errors were encountered: