I'm creating a document for students using quarto. One of the things I want to teach is how to read and understand error messages, so I was planning in creating wrong code blocks to force certain error messages (like the one below):
a_list = [1,2,"a"]
a_list[3]
# I want to generate an error to explain that python starts counting at 0
Regretfully, when I write the code above, quarto complains (with good reason) and will stop executing the rest of the code blocks and rendering the file.
Is there a way to get the error message while not stoping the execution?
I thought something like this would work, but it doesnt:
# | error: true
a_list[3]