Hello guys,
We implemented the script on our clients and seems that from somewhere inside your script is throwing your error first before our catch error.
This is the part of our piece of code that is expecting to throw our custom error in case something fails:
loadExternalScript("your_script_src", "script_id")
.then(() => {
if (hasTwitterFeatures()) { // This is where sometimes fails and throws your error and not our custom one.
renderTweets();
w.twttr.widgets.load(container);
Promise.resolve();
}
})
.catch((error) => {
Promise.reject(new Error(`Event type: ${error.type} and the Event detail: ${error.detail} and Event view: ${error.view}`));
});
const hasTwitterFeatures = () => window.twttr && window.twttr.events && window.twttr.widgets;
- Instead of throwing our custom error that we are catching, we are receiving this error (your error):
[Object Event]
- We are trying to deal with this error to see why in some cases it works and in some cases, it fails, but the error thrown is not clear enough and we had to put our custom error to see some details but fails…
- Any help will be much appreciated. (inside debugging or a un-minified version…etc)
- It’s happening randomly in our clients. Here are some examples:
https://www.davidemaggio.it/archives/167336/grande-fratello-vip-2018-ilary-blasi-umilia-fabrizio-corona-e-rimbalza-signorini
…etc