The fetch() API does not return a rejected promise when the server returns a status code different from 200. For example, a code status of 404 does not return a rejected promise.
A fetch() promise will reject with a TypeError when a network error is encountered, although this usually means permission issues or similar — a 404 does not constitute a network error, for example.
The downloadTranslation() function does not take into account this behavior.
The
fetch()
API does not return a rejected promise when the server returns a status code different from 200. For example, a code status of 404 does not return a rejected promise.Quoting the relevant MDN page:
The
downloadTranslation()
function does not take into account this behavior.