mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Improve handling for arbitrary package errors
e.g. if the package doesn't exist, it shouldn't simply die.
This commit is contained in:
@ -14,15 +14,17 @@
|
|||||||
table))))
|
table))))
|
||||||
|
|
||||||
(defmacro doom--condition-case! (&rest body)
|
(defmacro doom--condition-case! (&rest body)
|
||||||
`(condition-case-unless-debug ex
|
`(condition-case-unless-debug e
|
||||||
(progn ,@body)
|
(progn ,@body)
|
||||||
('user-error
|
('user-error
|
||||||
(print! (bold (red " NOTICE: %s" ex))))
|
(print! (bold (red " NOTICE: %s" e))))
|
||||||
('file-error
|
('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...")
|
(print! " Trying again...")
|
||||||
(quiet! (doom-refresh-packages-maybe t))
|
(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 ()
|
(defun doom--refresh-pkg-cache ()
|
||||||
"Clear the cache for `doom-refresh-packages-maybe'."
|
"Clear the cache for `doom-refresh-packages-maybe'."
|
||||||
|
Reference in New Issue
Block a user