Pop up traceback buffer on errors when executing code blocks

This commit is contained in:
Nathaniel Nicandro 2018-05-30 22:16:50 -05:00
parent 892ab84148
commit bbb677c573
2 changed files with 6 additions and 3 deletions

View file

@ -1273,6 +1273,7 @@ Do this for the current cell."
:comm-msg) :comm-msg)
(with-jupyter-repl-doc-buffer "traceback" (with-jupyter-repl-doc-buffer "traceback"
(jupyter-repl-insert-ansi-coded-text traceback) (jupyter-repl-insert-ansi-coded-text traceback)
(goto-char (line-beginning-position))
(pop-to-buffer (current-buffer)))) (pop-to-buffer (current-buffer))))
(t (t
(jupyter-repl-do-at-request client req (jupyter-repl-do-at-request client req

View file

@ -512,9 +512,11 @@ the PARAMS alist."
;; HACK: Prevent insertion of a file when an error happens ;; HACK: Prevent insertion of a file when an error happens
(let ((params (member "file" (alist-get :result-params params)))) (let ((params (member "file" (alist-get :result-params params))))
(and params (setcar params "scalar"))) (and params (setcar params "scalar")))
(if (eq result-type 'output) (setq traceback (mapconcat #'ansi-color-apply traceback "\n"))
(funcall add-result (mapconcat #'ansi-color-apply traceback "\n")) (with-jupyter-repl-doc-buffer "traceback"
(funcall add-result (format "%s: %s" ename (ansi-color-apply evalue))))) (jupyter-repl-insert-ansi-coded-text traceback)
(pop-to-buffer (current-buffer)))
(funcall add-result (format "%s: %s" ename (ansi-color-apply evalue))))
(when async (when async
;; Run the hooks here instead of in the status message to prevent ;; Run the hooks here instead of in the status message to prevent
;; any delays ;; any delays