我可以假设提取只能抛出个TypeError错误吗?
const request = async () => {
let response = null;
try {
response = await fetch('https://api.com/values/1');
} catch (err){
//is the err here is always of type typeError
}
if(!response.ok){
//bla bla bla 401/403 ...
}
const json = await response.json();
console.log(json);
}
request();