View Issue Details

IDProjectCategoryView StatusLast Update
0000237Composrcorepublic2011-04-28 16:20
ReporterChrisWAssigned ToChris Graham 
SeverityFeature-request 
Status closedResolutionfixed 
Product Version 
Fixed in Version 
Summary0000237: Built-in stack trace handling for AJAX calls
DescriptionComposr tends to give very informative output whenever something goes wrong during page generation. Once a page has been rendered, however, making calls to the site via AJAX leaves developers pretty much in the dark about any problems handling these calls. Sometimes a full page stack trace will be sent in response, which is useful but ideally such traces would get caught by some default Javascript and displayed prominently (eg. replacing the contents of body) rather than given straight to the callback. Other times a server will give no information other than an error status code, yet calling the same code from within a page load will generate a nice stack trace. I've found the best ways to debug AJAX calls to be 3-line printf debugging statements (make new tempcode, attach message to tempcode, return tempcode) since echo isn't too useful; and to temporarily replace an entire page call with the code being called by AJAX.
As more and more features are implemented after page load via Javascript, I think that it's going to be increasingly important to handle such problems in as uniform a way as Composr's stack traces do during page generation.
I think the most difficult part of this would be working out the most appropriate architecture, taking into account requirements like turning it on and off based on keep_ parameters (eg. only active if keep_fatalistic is set) and even per call via a parameter (eg. "get me this content if you can, but leave it alone if there's any problem"). Personally I'd be happy enough if this only works for load_snippet, but the more extensively it can be implemented the better.
TagsNo tags attached.
Time estimation (hours)
Sponsorship open

Activities

Chris Graham

2011-04-28 16:20

administrator   ~0000137

Turn off your popup blocker on your development domain, it already opens up a popup. Although I just saw this only happens on HTTP status 200, I'll fix that.

Issue History

Date Modified Username Field Change