Skip to content

Commit

Permalink
Forward file-missing errors from within autoloads
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
hlissner committed Aug 4, 2020
1 parent 7638bd3 commit 9f84bc3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/core.el
Expand Up @@ -514,9 +514,13 @@ to least)."
(file-missing
;; If the autoloads file fails to load then the user forgot to sync, or
;; aborted a doom command midway!
(signal 'doom-error
(list "Doom is in an incomplete state"
"run 'bin/doom sync' on the command line to repair it"))))
(if (equal (nth 3 e) doom-autoload-file)
(signal 'doom-error
(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
;; to do so if we're in terminal Emacs, where Emacs correctly inherits
Expand Down

0 comments on commit 9f84bc3

Please sign in to comment.