How can I add an try catch in a addEventListener? Is there any way?
I need to use the try catch at addEventListener or attachEvent not in the inner function
    document.addEventListener("DOMContentLoaded", function (event) {
 X();
    });
    document.attachEvent("onreadystatechange", function () {
        if (document.readyState === "complete") {
            X();
        }
    });