Question

I am doing an ajax post to a django view. Since I am not returning a page but data to my ajax call back, I do not get a stack trace. How do I print my errors in the view?

The error is happening when I do a save if that helps.

Was it helpful?

Solution

If you're using jQuery:

$.ajax({
    // ...
    error: function(jqXHR, textStatus, errorThrown) {
        console.log(errorThrown);
    }
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top