https://github.com/eudoxia0/clack-errors
Error page middleware for Clack.
https://github.com/eudoxia0/clack-errors
Last synced: about 1 year ago
JSON representation
Error page middleware for Clack.
- Host: GitHub
- URL: https://github.com/eudoxia0/clack-errors
- Owner: eudoxia0
- Archived: true
- Created: 2013-11-20T19:11:26.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-07-24T17:22:37.000Z (over 6 years ago)
- Last Synced: 2025-03-26T03:13:34.451Z (about 1 year ago)
- Language: JavaScript
- Size: 295 KB
- Stars: 27
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cl - clack-errors - Error page middleware for Clack. Unmaintained. [LLGPL][8]. (Interfaces to other package managers / Clack plugins)
README
# clack-errors
[](https://travis-ci.org/eudoxia0/clack-errors)
[](http://quickdocs.org/clack-errors/)


A clone of [better_errors](https://github.com/charliesome/better_errors)
for [Clack](https://github.com/fukamachi/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.
# Usage
This,
```lisp
(clack:clackup
(funcall clack-errors:*clack-error-middleware*
*my-clack-app*
:debug t)
:port 8000)))
```
will wrap your Clack up in the clack-errors middleware, start the server and
return a handler object.
By default, the middleware will show all information. In a production
environment, you'll want to initialize this with the `:debug` parameter set to
NIL.
## Using a Custom Error Page
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.
```lisp
(clack:clackup
(funcall clack-errors:*clack-error-middleware*
*app*
:fn (lambda (condition) "500 Internal Server Error")))
```
# License
Copyright (c) 2013–2019 Fernando Borretti (eudoxiahp@gmail.com)
Licensed under the LLGPL License.