The clack-errors Reference Manual

This is the clack-errors Reference Manual, version 0.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sat Dec 03 20:55:31 2022 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 clack-errors

Error page middleware for Clack.

Author

Fernando Borretti

Home Page

https://github.com/eudoxia0/clack-errors

License

LLGPL

Long Description

# clack-errors

[![Build Status](https://travis-ci.org/eudoxia0/clack-errors.svg?branch=master)](https://travis-ci.org/eudoxia0/clack-errors) [![Quicklisp](http://quickdocs.org/badge/clack-errors.svg)](http://quickdocs.org/clack-errors/)

![Development screenshot](https://raw.github.com/eudoxia0/clack-errors/master/screenshot-dev.png)
![Production screenshot](https://raw.github.com/eudoxia0/clack-errors/master/screenshot-prod.png)

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.

Version

0.2

Dependencies
  • clack (system).
  • closer-mop (system).
  • local-time (system).
  • trivial-backtrace (system).
  • djula (system).
  • cl-ppcre (system).
Source

clack-errors.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 clack-errors/src

Source

clack-errors.asd.

Parent Component

clack-errors (system).

Child Component

clack-errors.lisp (file).


4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 clack-errors/clack-errors.asd

Source

clack-errors.asd.

Parent Component

clack-errors (system).

ASDF Systems

clack-errors.


4.1.2 clack-errors/src/clack-errors.lisp

Source

clack-errors.asd.

Parent Component

src (module).

Packages

clack-errors.

Public Interface

*clack-error-middleware* (special variable).

Internals

5 Packages

Packages are listed by definition order.


5.1 clack-errors

Source

clack-errors.lisp.

Nickname

lack.middleware.clack.errors

Use List

common-lisp.

Public Interface

*clack-error-middleware* (special variable).

Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Special variables

Special Variable: *clack-error-middleware*
Package

clack-errors.

Source

clack-errors.lisp.


6.2 Internals


6.2.1 Special variables

Special Variable: *dev-css-path*
Package

clack-errors.

Source

clack-errors.lisp.

Special Variable: *highlight-css*
Package

clack-errors.

Source

clack-errors.lisp.

Special Variable: *highlight-js*
Package

clack-errors.

Source

clack-errors.lisp.

Special Variable: *prod-css-path*
Package

clack-errors.

Source

clack-errors.lisp.

Special Variable: +backtrace-regex+

A regular expression to split backtraces

Package

clack-errors.

Source

clack-errors.lisp.

Special Variable: +dev-template+
Package

clack-errors.

Source

clack-errors.lisp.

Special Variable: +prod-template+
Package

clack-errors.

Source

clack-errors.lisp.


6.2.2 Ordinary functions

Function: condition-name (condition)
Package

clack-errors.

Source

clack-errors.lisp.

Function: condition-slots (condition)
Package

clack-errors.

Source

clack-errors.lisp.

Function: parse-backtrace (bt)
Package

clack-errors.

Source

clack-errors.lisp.

Function: render (bt condition env)
Package

clack-errors.

Source

clack-errors.lisp.

Function: render-prod (condition env)
Package

clack-errors.

Source

clack-errors.lisp.

Function: slot-values (obj)
Package

clack-errors.

Source

clack-errors.lisp.

Function: split-backtrace (str)
Package

clack-errors.

Source

clack-errors.lisp.


Appendix A Indexes


A.1 Concepts