I am dealing with an array of promises that include simple API URLs to fetch Github users. I have tried deliberately putting a wrong URL in one of the values in the array, but it always resolves instead of rejecting. Any idea why this might be happening?
For reference, here is a link to my test case: https://jsbin.com/lapibalate/edit?js,console
let urlMap = [
{
url: 'https://api.github.com/users/andreepratama27',
},
{
url: 'https://apiiiiiii.github.com/users/rizalfakhri12'
}
]
let promises = urlMap.map(v => fetch(v))
Promise.all(promises)
.then(res => console.log('RESOLVED'))
.catch(err => console.log("REJECTED"))