Forward file-missing errors from within autoloads

If a load call occurs within the autoloads file and throws a
file-missing error, it would be misleading to say 'doom sync' will fix
it, so forward the real error!
This commit is contained in:
Henrik Lissner 2020-08-04 07:34:16 -04:00
parent 7638bd3968
commit 9f84bc334b
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -514,9 +514,13 @@ to least)."
(file-missing (file-missing
;; If the autoloads file fails to load then the user forgot to sync, or ;; If the autoloads file fails to load then the user forgot to sync, or
;; aborted a doom command midway! ;; aborted a doom command midway!
(signal 'doom-error (if (equal (nth 3 e) doom-autoload-file)
(list "Doom is in an incomplete state" (signal 'doom-error
"run 'bin/doom sync' on the command line to repair it")))) (list "Doom is in an incomplete state"
"run 'bin/doom sync' on the command line to repair it"))
;; Otherwise, something inside the autoloads file is triggering this
;; error; forward it!
(apply #'doom-autoload-error e))))
;; Load shell environment, optionally generated from 'doom env'. No need ;; Load shell environment, optionally generated from 'doom env'. No need
;; to do so if we're in terminal Emacs, where Emacs correctly inherits ;; to do so if we're in terminal Emacs, where Emacs correctly inherits