On 2005-12-22, Michael Peters <[EMAIL PROTECTED]> wrote: > --------------050005070307000502030607 > Content-Type: text/plain; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > I decided to play with CAP::DebugScreen (since it uses my CAP::ViewCode and I > was interested to see what someone is doing with my stuff :) and I have to say > that I like it. It's fairly simple and really easy for tracking down fatal > errors with a nice stack trace. Overall it's pretty spiffy :)
I also am a fan. The pending integration with ViewCode goes the final mile-- you can click on the line where there is an error and jump right to that line with ViewCode. Now we just need a Firefox extension to reload the file in editor at just that line. Hmmm... > However, I did have some problems getting it to work correctly with my setup. > I > typically use an ErrorDocument setting in httpd.conf so that all errors are > the > same throughout a site. However, CAP::DebugScreen only works if fatal errors > are > thrown and it doesn't add a error_mode() but instead uses the 'error' > callback. > So while the callback is executed, no error_mode() exists, so C::A simply > croaks() and Apache will serve a different doc, not the one generated by > CAP::DebugScreen. > > Attached is a patch that will make CAP::DS add an error_mode during the init > phase instead of the error callback. > > But I was wondering about whether this is the right approach or not. In C::A, > the error callback will get executed on errors but it can never trap them. > Should this be the case? The callback will only be able to do things like > logging, etc. Is this the intent? The error callback is little experimental, because we weren't sure how people would use it. Logging was definitely a use case that we had in mind. DebugScreen didn't exist then. Anyway, you might try sending you patch through RT, since I haven't noticed this module author lurking here. It looks like there is also CGI::Carp::DebugScreen now, too: http://search.cpan.org/~ishigaki/CGI-Carp-DebugScreen-0.03/ Which will be useful for non CGI::App projects. Mark --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[email protected]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
