Re: [whatwg/fetch] Should specify the error messages (#1147)

Given the desires use-case of being able to identify a specific type of error and that:
- many errors are localized (ex: Firefox's [en-us dom.properties](https://searchfox.org/mozilla-central/source/dom/locales/en-US/chrome/dom/dom.properties) and [all other locales](https://searchfox.org/l10n/search?q=&path=dom.properties))
- In the case of fetch many details about the specific reason for an error cannot be exposed to content due to cross-origin concerns, but could be exposed to devtools or webdriver which operate with superpowers

I think the platform meta issue might better be to:
- Introduce a specific error subtype / minor error code and continue to leave implementations to their own translations across all locales for `message`.
- Have the subtype be privileged information that only would be exposed by the platform through testing/devtools superpowers like webdriver and the devtools console rendering of errors.  (I proposed something like this briefly a long time ago in https://github.com/web-platform-tests/wpt/issues/4751).

So for the specific unit testing situation here, the test would:
1. Need to be running in a context where its global was blessed to be able to see the privileged subtypes or use some super-powered wrapper/oracle function that it imports
2. assert on the subtype and ignore the message 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1147#issuecomment-768559066

Received on Wednesday, 27 January 2021 20:33:53 UTC