Redesign Doom error handling
Another refactor, again to improve the locality of doom errors and make the data that accompanies them more useful in determining the origin and source of issues. Also, bin/doom is now a little more informative about how to debug errors.
This commit is contained in:
parent
84756b33a0
commit
151858a8dc
5 changed files with 89 additions and 64 deletions
17
bin/doom
17
bin/doom
|
@ -85,5 +85,18 @@
|
|||
((let ((default-directory emacs-dir))
|
||||
(setq argv nil
|
||||
noninteractive 'doom)
|
||||
(doom-dispatch args)))))
|
||||
|
||||
(condition-case e (doom-dispatch args)
|
||||
((debug error)
|
||||
(message "--------------------------------------------------\n")
|
||||
(message "There was an unexpected error:")
|
||||
(message " %s (%s)" (get (car e) 'error-message) (car e))
|
||||
(dolist (item (cdr e))
|
||||
(message " %s" item))
|
||||
(unless debug-on-error
|
||||
(message
|
||||
(concat "\nRun the command again with the -d (or --debug) option to enable debug\n"
|
||||
"mode and, hopefully, generate a stack trace. If you decide to file a bug\n"
|
||||
"report, please include it!\n\n"
|
||||
"Emacs outputs to standard error, so you'll need to redirect stderr to\n"
|
||||
"stdout to pipe this to a file or clipboard!\n\n"
|
||||
" e.g. doom -d install 2>&1 | clipboard-program")))))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue