Handle errors of code blocks and return them to the user#86
Open
KaiHa wants to merge 2 commits intoastahlman:masterfrom
Open
Handle errors of code blocks and return them to the user#86KaiHa wants to merge 2 commits intoastahlman:masterfrom
KaiHa wants to merge 2 commits intoastahlman:masterfrom
Conversation
During the execution of code blocks an error could be signaled. The
consequence of this would be that the FINISH-FUNC will not be called.
Therefore handle the error in the START-FUNC and return a textual
representation of it instead of the result.
A code block like the following
```
#+begin_src emacs-lisp :async
(error "somewhere an error was signaled")
#end_src
```
would no longer lead to a #+result that gets never updated and keeps
the UUID forever. Instead the following would be put as the result:
Failure: during the async execution of your code block the following error was signaled:
error: (somewhere an error was signaled)
At least shell and python source code blocks could fail without any possibility to notice it. Therefore adding an advice to org-babel-eval-error-notify that will set the variable ob-async-eval-error in the case of an error. If this variable is set, return the error. With this the following code blocks should produce a result that gives a hint about the error: ``` #+begin_src sh :results output :async echo something went wrong >&2 false #+end_src ``` ``` #+begin_src python :async raise NotImplementedError #+end_src ```
Author
|
This should also fix #81. |
|
I would love to see this merged! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During the execution of code-blocks some errors could go unnoticed. This PR adds code that will return an error description to the user. With this the following code blocks should return error messages instead of silently failing:
See the individual commits for details.
And thanks for this awesome package.