You are much much better off just using #catch at the top level caller.
constfetchUsers=async()=>{returnawaitfetch('')}constfetchPosts=async()=>{throwError('error in getting posts')returnawaitfetch('')}constfetchEverything()=async()=>{return[fetchUsers(),fetchPosts()]}// fetchEverything, as the top level caller, should have the catch handlerfetchEverything().then(results=>{// do something with results}).catch(err=>{// do something with err. You have two non-mutually-exclusive options.// console.log and don't crash anythingconsole.log(err)alert('Something has failed. Please try again later.')// AND/OR, you can throw the error to "bubble up" the error.// If there is another caller with a catch handler, this error will bubble up there.// Otherwise, it will get thrown into the main scope to stop execution.throwerr})
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You are much much better off just using #catch at the top level caller.