Include straight error in doom.error.log

This commit is contained in:
Henrik Lissner
2021-03-12 17:06:10 -05:00
parent d667a2a292
commit fc75573962

View File

@ -255,11 +255,12 @@ BODY will be run when this dispatcher is called."
(cl-incf num-nonmacro-input-events)
(cl-destructuring-bind (backtrace &optional type data . _)
(cons (doom-cli--backtrace) data)
(cond
((and (bound-and-true-p straight-process-buffer)
(stringp data)
(let ((straight-error-p
(and (bound-and-true-p straight-process-buffer)
(string-match-p (regexp-quote straight-process-buffer)
data))
(or (get type 'error-message) "")))))
(cond
(straight-error-p
(print! (error "There was an unexpected package error"))
(when-let (output (straight--process-get-output))
(print-group!
@ -285,9 +286,11 @@ BODY will be run when this dispatcher is called."
(print-escape-control-characters t)
(print-level nil)
(print-circle nil))
(when straight-error-p
(print (string-trim (or (straight--process-get-output) ""))))
(mapc #'print (cons (list type data) backtrace)))
(print! (warn "Extended backtrace logged to %s")
(relpath doom-cli-log-error-file)))))
(relpath doom-cli-log-error-file))))))
(throw 'exit 255))
(defun doom-cli--backtrace ()