I have a function that adds an external script dynamically. here is my code
try {
const script = document.createElement('script');
script.src = 'script url';
script.async = isAsync;
document.body.appendChild(script);
} catch(e){
console.log(e);
}
but when exception occurs in the script, try catch not catching that error. Also my code is inside react error boundary but still my react app crashes on script error. Even error boundary is not catch that error