Improve general error handling at startup

This will hopefully reveal more information as to the cause and origin
of errors at startup. It should also make doom-debug-mode more likely to
produce a backtrace in non-interactive sessions.
This commit is contained in:
Henrik Lissner 2018-06-18 14:47:36 +02:00
parent c8aba6f552
commit ab07e07352
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
6 changed files with 87 additions and 68 deletions

View file

@ -770,12 +770,9 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
total-ok (- (length target-files) total-noop)
total-noop))))
(error
(print! (red "\n%%s\n\n%%s\n\n%%s")
"There were breaking errors."
(error-message-string ex)
(print! (red "\n%s\n\n%%s" "There were breaking errors.")
"Reverting changes...")
(quiet! (doom-clean-byte-compiled-files))
(print! (yellow "Finished (nothing was byte-compiled)"))))))))
(signal 'doom-error (list 'byte-compile e))))))))
(defun doom-clean-byte-compiled-files ()
"Delete all the compiled elc files in your Emacs configuration and private