Improve handling for arbitrary package errors
e.g. if the package doesn't exist, it shouldn't simply die.
This commit is contained in:
parent
aa70213f87
commit
196638bf47
1 changed files with 6 additions and 4 deletions
|
@ -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'."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue