diff options
| author | Marius Peter <dev@marius-peter.com> | 2025-11-21 20:26:44 +0100 |
|---|---|---|
| committer | Marius Peter <dev@marius-peter.com> | 2025-11-21 20:26:44 +0100 |
| commit | 77a113ac756e071348b5499d1660563f63f415b5 (patch) | |
| tree | 3b95089ce974d568cfd3f19793aaf73c65069f46 | |
| parent | 03766ee794ab457dcce6e817e81dd7cc6cd038fe (diff) | |
Add exception handling at the top level function.
| -rw-r--r-- | main.rkt | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -9,7 +9,11 @@ (define-runtime-path development-db-path "storage/development.sqlite3") (module+ main - (connect! #:path development-db-path) - (migrate-all!) - (seed-database!) - (serve/dispatch app-dispatch)) + (with-handlers ([exn:fail? + (λ (e) + (printf "Startup error: ~a\n" (exn-message e)) + (exit 1))]) + (connect! #:path development-db-path) + (migrate-all!) + (seed-database!) + (serve/dispatch app-dispatch))) |