fix(cli): prevent oversized error data spam

A backtrace with a sufficiently large object (especially with circular
references) could unhelpfully flood the screen.
This commit is contained in:
Henrik Lissner 2022-06-22 19:10:04 +02:00
parent 2660fcce25
commit 2aca862187
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -935,7 +935,11 @@ considered as well."
(error-message-string data) (error-message-string data)
(get (car data) 'error-message))) (get (car data) 'error-message)))
(unless generic? (unless generic?
(print! "%s %S" (bold "Details:") (cdr data))) (print! "%s %s" (bold "Details:")
(let* ((print-level 3)
(print-circle t)
(print-escape-newlines t))
(prin1-to-string (cdr data)))))
(when backtrace (when backtrace
(print! (bold "Backtrace:")) (print! (bold "Backtrace:"))
(print-group! (print-group!