From 9e5ba5fd6c1604fe027912f9bada93108c99ab09 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 14 May 2021 15:02:07 -0400 Subject: [PATCH] Don't suppress user-error errors Refactor doom-run-hooks warning. --- core/core.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/core.el b/core/core.el index e3337e40c..5cf3a27cd 100644 --- a/core/core.el +++ b/core/core.el @@ -516,8 +516,6 @@ Meant to be used with `run-hook-wrapped'." (doom-log "Running doom hook: %s" hook) (condition-case-unless-debug e (funcall hook) - (user-error - (warn "Warning: %s" (error-message-string e))) (error (signal 'doom-hook-error (list hook e)))) ;; return nil so `run-hook-wrapped' won't short circuit @@ -531,7 +529,11 @@ Is used as advice to replace `run-hooks'." (run-hook-wrapped hook #'doom-run-hook) (doom-hook-error (unless debug-on-error - (lwarn hook :error "Error running hook %S because: %s" (cadr e) (caddr e))) + (lwarn hook :error "Error running hook %S because: %s" + (if (symbolp (cadr e)) + (symbol-name (cadr e)) + (cadr e)) + (caddr e))) (signal 'doom-hook-error (cons hook (cdr e))))))) (defun doom-run-hook-on (hook-var trigger-hooks)