You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a 404 not found response is made for an HTTP/s import, the error thrown is currently:
Error [ERR_NETWORK_IMPORT_BAD_RESPONSE]: import 'https://h3manth.com/foo' received a bad response: HTTP response returned status code of 404
it might be useful to convert this into a full ERR_MODULE_NOT_FOUND error to properly match semantics in error handling code paths.
What is the feature you are proposing to solve the problem?
Return an ERR_MODULE_NOT_FOUND for 404 network errors in HTTP/s imports.
What alternatives have you considered?
Keeping it as a custom error or network not found error creates divergence between local and remote resolvers. It can be useful to streamline the error path handling by having a singular code to check.
That sounds appropriate to me! Should we also handle other 4XX response statuses like 401 & 403? I took a quick look through existing error codes, and I didn't see anything appropriate for those two (so perhaps a new ERR_NETWORK_AUTH_FAILURE or following fs access failures, ERR_NETWORK_EACCESS?).
There is a second question here of "whether 404s should be cached or should a second import attempt attempt to make the request again" - but I won't change it in that PR
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
Activity
guybedford commentedon Feb 12, 2022
/cc @JakobJingleheimer would be interested to get your thoughts on this one.
JakobJingleheimer commentedon Feb 12, 2022
That sounds appropriate to me! Should we also handle other 4XX response statuses like 401 & 403? I took a quick look through existing error codes, and I didn't see anything appropriate for those two (so perhaps a new
ERR_NETWORK_AUTH_FAILUREor following fs access failures,ERR_NETWORK_EACCESS?).benjamingr commentedon Feb 12, 2022
That whole function can be simplified significantly by avoiding
new PromiseI believebenjamingr commentedon Feb 12, 2022
Should I maybe add the 404 error handling to #41950 ?
guybedford commentedon Feb 12, 2022
Would be great to see actually.
benjamingr commentedon Feb 13, 2022
There is a second question here of "whether 404s should be cached or should a second import attempt attempt to make the request again" - but I won't change it in that PR
benjamingr commentedon Feb 13, 2022
Done + added "fixes" #41950
benjamingr commentedon Feb 16, 2022
Would be great to get some reviews on that PR from people interested in the feature request :)
github-actions commentedon Aug 16, 2022
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
benjamingr commentedon Aug 16, 2022
Was fixed a while ago