Commit 380d677a authored by Eric Timmons's avatar Eric Timmons
Browse files

Print better errors in groveler

parent bbf7df9f
...@@ -96,14 +96,16 @@ ...@@ -96,14 +96,16 @@
:loaded-systems ,(gethash source-file *directly-loaded-systems*)))) :loaded-systems ,(gethash source-file *directly-loaded-systems*))))
(defun call-with-error-handling (thunk) (defun call-with-error-handling (thunk)
(handler-case (handler-bind ((asdf:missing-component
(values (funcall thunk) nil nil) (lambda (c)
(asdf:missing-component (c) (return-from call-with-error-handling
(values nil nil (string-downcase (string (asdf/find-component:missing-requires c))))) (values nil nil (string-downcase (string (asdf/find-component:missing-requires c)))))))
(error (c) (error (lambda (c)
(values nil (with-output-to-string (s) (return-from call-with-error-handling
(uiop:print-condition-backtrace c :stream s)) (values nil (with-output-to-string (s)
nil)))) (uiop:print-condition-backtrace c :stream s))
nil)))))
(values (funcall thunk) nil nil)))
(defmacro with-error-handling (nil &body body) (defmacro with-error-handling (nil &body body)
`(call-with-error-handling (lambda () ,@body))) `(call-with-error-handling (lambda () ,@body)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment