401 Unauthorized does not get handled by .catch
Closed this issue · 1 comments
kr094 commented
A 401 unauthorized throws an exception from JS and cannot be handled with a .catch().
Steps to reproduce:
- fetchival('api.php').then(...).catch(function (error) { console.log(error); });
- Have server return a 401
- Exception: index.min.js:1 Uncaught (in promise) Error: Unauthorized
at index.min.js:1
at - catch block is never called
Browser:
Chrome 63.0.3239.132 (Official Build) (64-bit)
Fetchival latest pulled from https://github.com/typicode/fetchival/blob/master/index.min.js yesterday
kr094 commented