barbushin / javascript-errors-notifier

Google Chrome and Firefox extension that notifies about JavaScritp errors by icon in address bar & popups
MIT License
205 stars 62 forks source link

JS Errors not showing on Ajax calls #59

Open danielmarkavis opened 8 years ago

danielmarkavis commented 8 years ago

When I perform an ajax calls, JEN does not show that there are errors.

(JSfile).js:4 GET (ajaxLink) 500 (Internal Server Error) is the one I have (from Chrome Console).

MattEllison commented 7 years ago

@danielmarkavis are you taking about failed ajax calls?

I wanted to be alerted as well and since I use jquery I found this global ajax event that's called whenever an ajax error has occurred. So you just throw an exception and it seems to work.

http://api.jquery.com/ajaxerror/

        $(document).ajaxError(function (event, jqxhr, settings, thrownError) {
            console.log({
                event,
                jqxhr,
                settings,
                thrownError
            });
            throw JSON.stringify(thrownError + " --- See Console Window for more details");
        });