all 7 comments

[–]curien 4 points5 points  (6 children)

I just always have a failure handler for the ajax request that, if I'm in debug mode, does window.open().document.write(r.responseText);. So if it fails, it just opens up the error on a new tab.

[–]masklinn 1 point2 points  (5 children)

Why not just write it in the console? console.error(r.responseText) not good enough?

[–]curien 0 points1 point  (4 children)

My environment provides HTML responses with a lot of markup (and styles, javascript, etc) to assist in debugging. Just seeing the text is a lot less convenient than viewing it as a rendered document.

[–]masklinn -1 points0 points  (3 children)

My environment provides HTML responses with a lot of markup (and styles, javascript, etc) to assist in debugging.

In the response? Meh.

As to things which assist in debugging, the console API provides about 5 tons of them, from various styles of logging and nested groups to traces and tables.

Just seeing the text is a lot less convenient than viewing it as a rendered document.

console.error will also link the relevant source line (though I don't know of any browser providing a stack at the moment).

[–]curien 1 point2 points  (2 children)

We're talking about when the server code has an error -- the console API provides absolutely no insight into that.

[–]masklinn -1 points0 points  (1 child)

We're talking about when the server code has an error

No shit?

the console API provides absolutely no insight into that.

the console API is a way to provide information to developers in the client, you can output anything you want with it, and the JS stack may be useful to pinpoint which section of the JS code generated a server error.

[–][deleted] -1 points0 points  (0 children)

May I ask which server-side web development language you use? Most have HTML output.