DEV Community

[Comment from a deleted post]
Collapse
 
djheru profile image
Philip Damra

This is a good point. In this case, you would want to make sure that the async functions you're calling (e.g. GetAllStates()) are catching and handling their own errors. Another option is to use Promise.allSettled() which will return objects that have a status of 'fulfilled' or 'rejected' and either a value (the return value of the function) or a reason (the error message) if rejected.