The catch statement will be executed when the error occurs. As the Promise.allSettled() always resolves, you can manually throw an error i.e.
if(posts.status === "rejected"){
throw new Error('a status was rejected');
}
* Be the first to Make Comment