Uncaught TypeError: Cannot read property 'status' of undefined

trying raygun

Posted on
Dec 13 2013

I get an error message "Uncaught TypeError: Cannot read property 'status' of undefined " when I'm throwing an error manually. The code looks like this:

$(function(){
var errorMessages = $('*:contains("Error")');
if (errorMessages.length != 0) {
    var errorMessage = errorMessages.last().text();
    throw errorMessage;
}

});


trying raygun

Posted on
Dec 13 2013

err... read the fine manual, code should be:

$(function(){
var errorMessages = $('*:contains("Error")');
if (errorMessages.length != 0) {
    var errorMessage = errorMessages.last().text();
    try {
        throw new Error(errorMessage);
    } catch (e) {
        Raygun.send(e);
    }
}
});

https://github.com/MindscapeHQ/raygun4js


Reply