The opaque error message is intentional: if your web app crashes, you don't necessarily want to expose internal details to every user that comes along (one famous case was reddit.com, which leaked a portion of their Python codebase inside a stack trace at some point). However, if you set the
development-modeglobal variable to a true value, the behavior of the HTTP server changes in two respects:
- If an error occurs, the error page contains the error message as well as the full stack trace.
- Every request begins by calling
refresh-all, thus interactive testing of web app changes becomes very straightforward.
If we enable development mode, we see the real error message, "No such table: SESSIONS". This is because I didn't mention that one must initialize the database by creating the table for storing sessions first:
"counter.db" sqlite-db [ init-sessions-table ] with-db
In the next installment of this series, which hopefully won't take as long as the second one did, I will discuss form validation and the templating system.