Así que chicos, tengo 2 funciones, la primera se llama child Function() , la segunda es parentFunction() . Así que estoy tratando de obtener un error de childFunction() , donde childFunction() contiene el siguiente código
async childFunction() { await getFromApi() } y traté de llamar a childFunction() desde parentFunction() así
async parentFunction() { try { await childFunction() } catch (e) { console.log(e) } }mi error esperado
Uncaught (in promise) TypeError: Failed to fetch at fetchWith (fetch.browser.js?273a:103:1) at Client.fetch (http.js?670b:132:1) at Client.fetch (core.js?0abd:182:1) at Client.post (http.js?670b:174:1) at addAll (add-all.js?74f2:31:1) at async last (index.js?9975:13:1) at async Object.add (add.js?59bb:18:1) pero no me sale ningún error ni consola. Por lo tanto, solo se puede acceder al error en childFunction() solo cuando uso try-catch en childFunction() . Incluso entonces no puedo enviar el error a parentFunction() . Entonces mi pregunta, cómo enviar un error de childFunction() a parentFunction() . Gracias de antemano