Add error handling when loading autoloads files

This commit is contained in:
Henrik Lissner 2018-06-04 21:20:13 +02:00
parent 29005d9975
commit 6da8e5b3ab
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -287,7 +287,11 @@ non-nil."
"Tries to load FILE (an autoloads file). Otherwise tries to regenerate it. If "Tries to load FILE (an autoloads file). Otherwise tries to regenerate it. If
CLEAR-P is non-nil, regenerate it anyway." CLEAR-P is non-nil, regenerate it anyway."
(unless clear-p (unless clear-p
(load (file-name-sans-extension file) 'noerror 'nomessage))) (condition-case-unless-debug e
(load (file-name-sans-extension file) 'noerror 'nomessage)
('error
(message "Autoload error: %s -> %s"
(car e) (error-message-string e))))))
(defun doom-initialize-packages (&optional force-p) (defun doom-initialize-packages (&optional force-p)
"Ensures that Doom's package management system, package.el and quelpa are "Ensures that Doom's package management system, package.el and quelpa are