4

When there is something that fires Ajax or XHR Request, sometimes, if the php (or other server side script) has some fatal error, the Chrome browser returns such response:

enter image description here

However, if we manually open that failing url, then the browser shows the output from that page (i.e. Fatal error - $variable not defined or whatever ). How to see that actual response message in chrome, instead of the 500 (Internal Server Error) ?

T.Todua
  • 53,146
  • 19
  • 236
  • 237

1 Answers1

0

Not a solution, but if someone needs to get more details about that call, hook a function into AJAX/XHR request (define this in chrome console):

(function() {
    var origOpen = XMLHttpRequest.prototype.open;
    XMLHttpRequest.prototype.open = function() {
        this.addEventListener('load', function() {
            console.log(this);
        });
        origOpen.apply(this, arguments);
    };
})();

After that, when triggering the AJAX action, the console will show the details.

T.Todua
  • 53,146
  • 19
  • 236
  • 237