抓取不会捕获错误,例如:
try {
fetch('exampleInvalidUrl.com')
.then(response => response.json())
.then(responseJSON => responseJSON.map(object => object))
}
catch {
console.log('error') // this should throw an error but it doesn't
}
我该如何解决? //此示例仅不会在react-native应用上引发错误