mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -05:00
jupyter-eval: Raise an error if one is returned by the kernel
This commit is contained in:
parent
6f67c0a3d5
commit
bc7f9b4fb5
1 changed files with 10 additions and 3 deletions
|
@ -958,9 +958,16 @@ text/plain representation."
|
|||
(cl-check-type jupyter-current-client jupyter-kernel-client
|
||||
"Need a client to evaluate code")
|
||||
(let ((msg (jupyter-wait-until-received :execute-result
|
||||
(let ((jupyter-inhibit-handlers t))
|
||||
(jupyter-send-execute-request jupyter-current-client
|
||||
:code code :store-history nil)))))
|
||||
(let* ((jupyter-inhibit-handlers t)
|
||||
(req (jupyter-send-execute-request jupyter-current-client
|
||||
:code code :store-history nil)))
|
||||
(prog1 req
|
||||
(jupyter-add-callback req
|
||||
:execute-reply
|
||||
(lambda (msg)
|
||||
(jupyter-with-message-content msg (status evalue)
|
||||
(unless (equal status "ok")
|
||||
(error "%s" (ansi-color-apply evalue)))))))))))
|
||||
(when msg
|
||||
(jupyter-message-data msg (or mime :text/plain)))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue