Improve handling for arbitrary package errors

e.g. if the package doesn't exist, it shouldn't simply die.
This commit is contained in:
Henrik Lissner 2018-06-24 20:11:57 +02:00
parent aa70213f87
commit 196638bf47
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -14,15 +14,17 @@
table))))
(defmacro doom--condition-case! (&rest body)
`(condition-case-unless-debug ex
`(condition-case-unless-debug e
(progn ,@body)
('user-error
(print! (bold (red " NOTICE: %s" ex))))
(print! (bold (red " NOTICE: %s" e))))
('file-error
(print! (bold (red " FILE ERROR: %s" (error-message-string ex))))
(print! (bold (red " FILE ERROR: %s" (error-message-string e))))
(print! " Trying again...")
(quiet! (doom-refresh-packages-maybe t))
,@body)))
,@body)
('error
(print! (bold (red " FATAL ERROR: %s\n Run again with the -d flag for details" e))))))
(defun doom--refresh-pkg-cache ()
"Clear the cache for `doom-refresh-packages-maybe'."