6
async/await
でエラーをキャッチする方法がhttps://jakearchibald.com/2014/es7-async-functions/とこのhttp://pouchdb.com/2015/03/05/taming-the-async-beast-with-es7.htmlのような記事ではうまくいかないと誤解されましたが、私のcatch
ブロックは400/500をキャッチしません。try..catchエラーが発生しました
async() => {
let response
try {
let response = await fetch('not-a-real-url')
}
catch (err) {
// not jumping in here.
console.log(err)
}
}()
example on codepen if it helps
AFAKフェッチAPIが400/500エラーをconsidterいけません – VeXii