From 196638bf47f968c6f5a4f9ecc72eed6251446560 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 24 Jun 2018 20:11:57 +0200 Subject: [PATCH] Improve handling for arbitrary package errors e.g. if the package doesn't exist, it shouldn't simply die. --- core/autoload/packages.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/autoload/packages.el b/core/autoload/packages.el index 804ed62c4..13c03d121 100644 --- a/core/autoload/packages.el +++ b/core/autoload/packages.el @@ -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'."