Move doom--condition-case! to core/cli/packages

The only place it is being used
This commit is contained in:
Henrik Lissner 2019-01-10 15:44:42 -05:00
parent 4b2dbe42a5
commit 31a0ad5b95
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 13 additions and 13 deletions

View file

@ -13,19 +13,6 @@
nil t)
table))))
(defmacro doom--condition-case! (&rest body)
`(condition-case-unless-debug e
(progn ,@body)
('user-error
(print! (bold (red " NOTICE: %s")) e))
('file-error
(print! (bold (red " FILE ERROR: %s")) (error-message-string e))
(print! " Trying again...")
(quiet! (doom-refresh-packages-maybe t))
,@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'."
(setq doom--refreshed-p nil)

View file

@ -14,6 +14,19 @@
;;
;; Helpers
(defmacro doom--condition-case! (&rest body)
`(condition-case-unless-debug e
(progn ,@body)
('user-error
(print! (bold (red " NOTICE: %s")) e))
('file-error
(print! (bold (red " FILE ERROR: %s")) (error-message-string e))
(print! " Trying again...")
(quiet! (doom-refresh-packages-maybe t))
,@body)
('error
(print! (bold (red " FATAL ERROR: %s\n Run again with the -d flag for details")) e))))
(defsubst doom--do (fn)
(doom-reload-doom-autoloads)
(when (funcall fn doom-auto-accept)