About
Example exception message and report
Uploaded 1 mo ago
by RobinHorton
- Object Notebook
Download
Exceptions¶
This notebook shows an example exceptions message and report.
For purposes of demonstration we run a question with non-sensical question_options
in order to generate a QuestionAnswerValidationError
and report with details on the error and a Performance Plot with graphical details (scroll to the bottom of the report to view).
Help debugging¶
We also show how to post the notebook to Coop which we recommend doing if you would like assistance debugging your exceptions. You can set the visibility of the notebook to public, unlisted or private, and then email us the link to inspect at info@expectedparrot.com
In [1]:
from edsl.questions import QuestionMultipleChoice
q = QuestionMultipleChoice(
question_name = "bad_instruction",
question_text = "What is your favorite color?",
question_options = ["breakfast", "lunch", "dinner"] # Non-sensical options for the question
)
results = q.run()
Attempt 1 failed with exception:Answer code must be a string, a bytes-like object or a real number (got Invalid). now waiting 1.00 seconds before retrying.Parameters: start=1.0, max=60.0, max_attempts=5. Attempt 2 failed with exception:Answer code must be a string, a bytes-like object or a real number (got None). now waiting 2.00 seconds before retrying.Parameters: start=1.0, max=60.0, max_attempts=5. Attempt 3 failed with exception:Answer code must be a string, a bytes-like object or a real number (got Invalid question). now waiting 4.00 seconds before retrying.Parameters: start=1.0, max=60.0, max_attempts=5. Attempt 4 failed with exception:Answer code must be a string, a bytes-like object or a real number (got None). now waiting 8.00 seconds before retrying.Parameters: start=1.0, max=60.0, max_attempts=5. Exceptions were raised in 1 out of 1 interviews.
"
Also see: https://docs.expectedparrot.com/en/latest/exceptions.html
In [ ]:
from edsl import Coop, Notebook
coop = Coop()
notebook = Notebook(path = "exceptions_example.ipynb")
coop.create(notebook, description="Example exception message and report", visibility="public")
In [ ]:
from edsl import Notebook
notebook = Notebook.pull("f6a19c77-3f57-4900-b0c9-436058a2ad27")
# this object is too large to display here