Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to capture errors? #201

Closed
tpoisot opened this issue Aug 13, 2022 · 6 comments · Fixed by #257
Closed

Option to capture errors? #201

tpoisot opened this issue Aug 13, 2022 · 6 comments · Fixed by #257

Comments

@tpoisot
Copy link

tpoisot commented Aug 13, 2022

I'm using Literate.jl to work on some class material, and in specific cases, I would like a code block to result in an error -- this is mostly to walk students through reading error messages.

Is there a way to keep error messages (possibly on a per-chunk basis)?

@BeastyBlacksmith
Copy link

BeastyBlacksmith commented Aug 30, 2023

I am looking for the same thing

@tpapp
Copy link
Contributor

tpapp commented Oct 11, 2024

I am using

try
    ... chunk ...
catch e
    showerror(stdout, e)
end

but having an option that wraps all code chunks in code like this would be great.

@tpapp
Copy link
Contributor

tpapp commented Oct 13, 2024

I am working on a PR, I think I just need to customize execute_block.

tpapp added a commit to tpapp/Literate.jl that referenced this issue Oct 14, 2024
fredrikekre pushed a commit to tpapp/Literate.jl that referenced this issue Oct 16, 2024
@tpoisot
Copy link
Author

tpoisot commented Oct 16, 2024

Wonderful - thanks @fredrikekre

@fredrikekre
Copy link
Owner

I'm innocent -- thank @tpapp

@tpoisot
Copy link
Author

tpoisot commented Oct 16, 2024

Thanks @tpapp !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants