-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
P3Low: Not priority right nowLow: Not priority right nowhelp wantedSeeking public contribution on this issueSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)
Description
I have quite a bit time figuring out why some of the tests were failing (in ipfs/js-ipfs#3081) on Firefox. Turns out structured clone algorithm throws when HTTError
is being posted over message channel
Lines 21 to 27 in 4cc3826
class HTTPError extends Error { | |
constructor (response) { | |
super(response.statusText) | |
this.name = 'HTTPError' | |
this.response = response | |
} | |
} |
There are multiple issues:
- Firefox does not yet support native Error types https://bugzilla.mozilla.org/show_bug.cgi?id=1556604
- Even with the above resolved
response: Response
still creates an issue.
I'm not sure what the appropriate course of action would be here, but here are few options:
- Making
response
non-enumerable property, which would be ignored. - Instead of attaching
Response
instance extendHTTPError
to include relevant data e.g:class HTTPError extends Error { constructor (response) { super(response.statusText) this.name = 'HTTPError' this.statusText = response.statusText this.responseType = response.type this.url = response.url this.status = response.status this.redirected = response.redirected } }
Metadata
Metadata
Assignees
Labels
P3Low: Not priority right nowLow: Not priority right nowhelp wantedSeeking public contribution on this issueSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)