Don't suppress user-error errors
Refactor doom-run-hooks warning.
This commit is contained in:
parent
755d4c7b15
commit
9e5ba5fd6c
1 changed files with 5 additions and 3 deletions
|
@ -516,8 +516,6 @@ Meant to be used with `run-hook-wrapped'."
|
||||||
(doom-log "Running doom hook: %s" hook)
|
(doom-log "Running doom hook: %s" hook)
|
||||||
(condition-case-unless-debug e
|
(condition-case-unless-debug e
|
||||||
(funcall hook)
|
(funcall hook)
|
||||||
(user-error
|
|
||||||
(warn "Warning: %s" (error-message-string e)))
|
|
||||||
(error
|
(error
|
||||||
(signal 'doom-hook-error (list hook e))))
|
(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
|
||||||
|
@ -531,7 +529,11 @@ Is used as advice to replace `run-hooks'."
|
||||||
(run-hook-wrapped hook #'doom-run-hook)
|
(run-hook-wrapped hook #'doom-run-hook)
|
||||||
(doom-hook-error
|
(doom-hook-error
|
||||||
(unless debug-on-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)))))))
|
(signal 'doom-hook-error (cons hook (cdr e)))))))
|
||||||
|
|
||||||
(defun doom-run-hook-on (hook-var trigger-hooks)
|
(defun doom-run-hook-on (hook-var trigger-hooks)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue