git clone 'https://github.com/eudoxia0/clack-errors.git'
A clone of better_errors for Clack.
By default, when Clack throws an exception when rendering a page, the server waits for the response until it times out while the exception waits in the REPL. This isn't very useful. So now there's this.
Simply add the
<clack-error-middleware> to your application's clackup form.
(clack:clackup (builder clack-errors:<clack-error-middleware> *app*))
By default, the middleware will show all information. In a production
environment, you'll want to initialize this with the
:debug parameter set to
If you use Envy to manage configuration, you'd initialize it like this:
(clack:clackup (builder (clack-errors:<clack-error-middleware> :debug (getf (envy:config :myapp) :debug)) *app*))
The middleware can be initialized with the
:fn slot set to a lambda that takes
a condition as its argument and returns the HTML string to return to the client.
(clack:clackup (builder (clack-errors:<clack-error-middleware> :fn (lambda (condition) "500 Internal Server Error") *app*))
Copyright (c) 2013-2015 Fernando Borretti (email@example.com)
Licensed under the LLGPL License.