Skip to content

Commit

Permalink
discard multiple values returned by handle-request
Browse files Browse the repository at this point in the history
In default method for `handler-request'

```
(throw 'handler-done
   (values nil cond (get-backtrace)))
```

is used, which is caught in `process-request' and the second return
value is used as error flag. However if handler-request returns
multiple values normally from user code, this also registers as
error.

For example, a define-easy-handler such as

```
(define-easy-handler (...) ()
    ...
    (gethash key table))
```

seems OK as user code. But the `gethash' returns T as second value
which undesirably leads to error.
  • Loading branch information
bpanthi977 authored and stassats committed Jun 21, 2021
1 parent 2a9a167 commit 2bda004
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion request.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ slot values are computed in this :AFTER method."
;; skip dispatch if bad request
(when (eql (return-code *reply*) +http-ok+)
(catch 'handler-done
(handle-request *acceptor* *request*)))
(values (handle-request *acceptor* *request*))))
(when error
;; error occurred in request handler
(report-error-to-client error backtrace))
Expand Down

0 comments on commit 2bda004

Please sign in to comment.