[hunchentoot-devel] Strange condition during error handling (possible double error?)

Tomasz Skutnik tomasz.skutnik at gmail.com
Sat May 10 22:01:27 UTC 2008


>
> In your method you're trying to unconditionally access the *REQUEST*
> variable which is only guaranteed to be bound to the current request
> object while a handler is executed.  In fact, the errors you're trying
> to deal with happen before a request object is created.
>
> Edi.

Thanks Edi. You mean maybe-invoke-debugger? I've modified to look like this:

(defmethod maybe-invoke-debugger ((condition
sb-int:simple-stream-error)) ; muffle useless condition reporting
      (cond ((boundp '*request*)
             (cond ((eql (search "/img/" (script-name *request*)) 0)
                    (log-message :warn "ignored condition for ~a: ~a"
(script-name *request*) condition))
                   (t (call-next-method))))
            (t nil)))

That's probably what I meant (sorry for algolesque):

- if *request* is bound (we're in handler):
  - if we're serving '/img/" -> ignore & log condition
  - otherwise -> call next method (i.e. invoke debugger)
- otherwise (we're somewhere in hunchentoot internals) -> ignore condition

Looks like that solves my problem - condition logged without
backtrace, debugger silenced.

Thanks again.

Tomasz



More information about the Tbnl-devel mailing list