diff options
-rw-r--r-- | src/main.lisp | 29 | ||||
-rw-r--r-- | src/package.lisp | 3 | ||||
-rw-r--r-- | wajir.asd | 3 |
3 files changed, 29 insertions, 6 deletions
diff --git a/src/main.lisp b/src/main.lisp index bd1e774..6076da7 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -1,7 +1,5 @@ (in-package :wajir) -(defparameter uiop:*lisp-interaction* nil) - (defun main () ;; Query page of issues ;; Start watching issue @@ -10,8 +8,31 @@ ;; TODO: Add SIGINT and error handling - (let ((config (parse-options))) - (run config))) + ;; Disable interactive debugger. + ; (defparameter uiop:*lisp-interaction* nil) + (setf *debugger-hook* #'debug-ignore) + + (handler-case + (interrupt:with-user-abort + (handler-bind ((error #'(lambda (e) + (exit-with-error e sysexits:+unavailable+)))) + + ; (let ((config (parse-options))) + ; (run config)) + + (format t "l-i: ~S~%" uiop:*lisp-interaction*) + (format t "main ran~%") + (sleep 5))) + + ;; Control-c + (interrupt:user-abort () + (format t "siginted~%") + (opts:exit 130)))) + +(defun debug-ignore (condition hook) + (declare (ignore hook)) + (princ condition) + (abort)) (defun run (config) (let ((basic-auth-token (cl-base64:string-to-base64-string diff --git a/src/package.lisp b/src/package.lisp index c48ccba..1b3ea43 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1,6 +1,7 @@ (defpackage :wajir (:use :cl) - (:local-nicknames (:jzon :com.inuoe.jzon)) + (:local-nicknames (:interrupt :with-user-abort) + (:jzon :com.inuoe.jzon)) (:export :main)) @@ -15,7 +15,8 @@ :com.inuoe.jzon :dexador :sysexits - :unix-opts) + :unix-opts + :with-user-abort) :components ((:module "src" :serial t :components ((:file "package") |