Hi,
I find myself using GET-TRACEBACK. In development mode, I let my unhandled conditions bubble up to the browser window but this would be undesirable for production mode, so for it I simply log that an error happened and display a nice error page. However, I find myself wishing that I had logged the condition using GET-TRACEBACK, like it's done in development mode, for easier debugging.
Make sense? Maybe I missing something or this is an internal you're not comfortable exporting. I thought I'd ask anyway.
Thanks, Erik.
On Tue, 22 Aug 2006 09:32:35 -0400, "Erik Enge" erik.enge@gmail.com wrote:
I find myself using GET-TRACEBACK. In development mode, I let my unhandled conditions bubble up to the browser window but this would be undesirable for production mode, so for it I simply log that an error happened and display a nice error page. However, I find myself wishing that I had logged the condition using GET-TRACEBACK, like it's done in development mode, for easier debugging.
Make sense? Maybe I missing something or this is an internal you're not comfortable exporting. I thought I'd ask anyway.
This one doesn't suffice?
http://weitz.de/tbnl/#*log-lisp-backtraces-p*
Cheers, Edi.
On 8/22/06, Edi Weitz edi@agharta.de wrote:
This one doesn't suffice?
Not unless I'm misunderstanding. When the application is in production mode the conditions never reach TBNL as I'm handling them by logging the error and returning some HTML (an error page).
Here's the code that is invoked when an error occurs:
(defun web-when-error (user dbcon request reply condition) (declare (ignore dbcon reply)) (if (eql *sys-class* :dev) (error condition) (progn (tbnl:log-message :error (tbnl::get-backtrace condition)) (case (type-of condition) (db:validation-error (validation-error-page user request condition)) (t (an-error-occurred-page user))))))
Am I missing something embarrassingly obvious?
Erik.
On Tue, 22 Aug 2006 10:48:28 -0400, "Erik Enge" erik.enge@gmail.com wrote:
Here's the code that is invoked when an error occurs:
(defun web-when-error (user dbcon request reply condition) (declare (ignore dbcon reply)) (if (eql *sys-class* :dev) (error condition) (progn (tbnl:log-message :error (tbnl::get-backtrace condition)) (case (type-of condition) (db:validation-error (validation-error-page user request condition)) (t (an-error-occurred-page user))))))
Am I missing something embarrassingly obvious?
No, it looks like I just missed something in your first email. I think it is possible to achieve what you have now with a combination of *HTTP-ERROR-HANDLER*, AUX-REQUEST-VALUE, and *LOG-LISP-BACKTRACES-P*, but it'd certainly be kind of tricky.
I'll just export GET-BACKTRACE in the next release.
Cheers, Edi.