Don't eat stacks in backtraces in debug mode

The error handlers were a little too effective. They obscured a large
chunk of the stacktrace after errors, even in debug mode. This fixes
that and ensures backtraces in debug mode are more helpful.
This commit is contained in:
Henrik Lissner 2018-06-18 17:14:17 +02:00
parent ca2c8b5a45
commit 4685eddb66
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 11 additions and 8 deletions

View file

@ -43,13 +43,14 @@ non-nil."
(condition-case e (condition-case e
(load (expand-file-name "init" doom-private-dir) (load (expand-file-name "init" doom-private-dir)
'noerror 'nomessage) 'noerror 'nomessage)
(error (signal 'doom-private-error (list 'init e))))))) ((debug error)
(signal 'doom-private-error (list 'init e)))))))
(defun doom-initialize-autoloads (file) (defun doom-initialize-autoloads (file)
"Tries to load FILE (an autoloads file). Return t on success, nil otherwise." "Tries to load FILE (an autoloads file). Return t on success, nil otherwise."
(condition-case e (condition-case e
(load (file-name-sans-extension file) 'noerror 'nomessage) (load (file-name-sans-extension file) 'noerror 'nomessage)
('error ((debug error)
(if noninteractive (if noninteractive
(message "Autoload file warning: %s -> %s" (car e) (error-message-string e)) (message "Autoload file warning: %s -> %s" (car e) (error-message-string e))
(signal 'doom-autoload-error e))))) (signal 'doom-autoload-error e)))))
@ -292,7 +293,8 @@ to least)."
(condition-case e (condition-case e
(load ,(expand-file-name "config" doom-private-dir) (load ,(expand-file-name "config" doom-private-dir)
t (not doom-debug-mode)) t (not doom-debug-mode))
(error (signal 'doom-private-error (list 'config e)))))))))) ((debug error)
(signal 'doom-private-error (list 'config e))))))))))
(defvar doom-disabled-packages) (defvar doom-disabled-packages)
(defmacro def-package! (name &rest plist) (defmacro def-package! (name &rest plist)

View file

@ -217,7 +217,7 @@ elsewhere."
,(if pkg-pin `(map-put package-pinned-packages ',name ,pkg-pin)) ,(if pkg-pin `(map-put package-pinned-packages ',name ,pkg-pin))
(map-put doom-packages ',name ',plist) (map-put doom-packages ',name ',plist)
(not (memq ',name doom-disabled-packages)))) (not (memq ',name doom-disabled-packages))))
(error ((debug error)
(signal 'doom-private-error (signal 'doom-private-error
(list (list 'packages name) e))))) (list (list 'packages name) e)))))

View file

@ -247,7 +247,8 @@ easier to tell where the came from.
Meant to be used with `run-hook-wrapped'." Meant to be used with `run-hook-wrapped'."
(condition-case e (condition-case e
(funcall hook) (funcall hook)
(error (signal 'doom-hook-error (list hook e)))) ((debug error)
(signal 'doom-hook-error (list hook e))))
;; return nil so `run-hook-wrapped' won't short circuit ;; return nil so `run-hook-wrapped' won't short circuit
nil) nil)

View file

@ -21,11 +21,11 @@ already there)."
;;;###autoload (autoload '+eshell:run "emacs/eshell/autoload/evil" nil t) ;;;###autoload (autoload '+eshell:run "emacs/eshell/autoload/evil" nil t)
(evil-define-command +eshell:run (command bang) (evil-define-command +eshell:run (command bang)
;; TODO Add COMMAND support "TODO"
(interactive "<fsh><!>") (interactive "<fsh><!>")
(if bang (if bang
(+eshell/open command) (+eshell/open nil command)
(+eshell/open-popup command))) (+eshell/open-popup nil command)))
;;;###autoload (autoload '+eshell/evil-change "emacs/eshell/autoload/evil" nil t) ;;;###autoload (autoload '+eshell/evil-change "emacs/eshell/autoload/evil" nil t)
(evil-define-operator +eshell/evil-change (beg end type register yank-handler delete-func) (evil-define-operator +eshell/evil-change (beg end type register yank-handler delete-func)