summaryrefslogtreecommitdiff
path: root/src/main.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.lisp')
-rw-r--r--src/main.lisp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/main.lisp b/src/main.lisp
index fa7fab0..e68ca40 100644
--- a/src/main.lisp
+++ b/src/main.lisp
@@ -20,26 +20,24 @@
20 20
21(enable-f-strings) 21(enable-f-strings)
22 22
23(defvar *in-prod* t) 23(defvar *in-prod* nil)
24
25(defmacro reporty ((evt) &body body)
26 `(cond
27 (*in-prod*
28 (handler-case (progn ,@body) ; lint:suppress redundant-progn
29 (error (err) (report-error ,evt err))))
30 (t ,@body)))
31 24
32(defun main () 25(defun main ()
33 (log:config :debug)
34 (unwind-protect 26 (unwind-protect
35 (progn 27 (progn
36 (conf:print-default #P"config.default.lisp")
37 (conf:load-config #P"config.lisp") 28 (conf:load-config #P"config.lisp")
38 (log:info "Starting up ~A" (conf:bot-name)) 29 (log:info "Starting up ~A" (conf:bot-name))
39 (main-with-config) 30 (main-with-config)
40 nil) 31 nil)
41 (log:info "Quitting!"))) 32 (log:info "Quitting!")))
42 33
34(defmacro reporty ((evt) &body body)
35 `(cond
36 (*in-prod*
37 (handler-case (progn ,@body) ; lint:suppress redundant-progn
38 (error (err) (report-error ,evt err))))
39 (t ,@body)))
40
43(defun main-with-config () 41(defun main-with-config ()
44 (unwind-protect 42 (unwind-protect
45 (with-db (db (conf:db-path)) 43 (with-db (db (conf:db-path))