marimo
marimo copied to clipboard
Support expected exceptions: Option to hide the traceback
Description
In some notebooks i need to have exceptions, because they provide useful information, for example:
from sage.all_cmdline import x, var, limit, exp, oo
var("a")
limit(exp(a * x), x=oo)
Gives:
ValueError
This cell raised an exception: ValueError('Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(a>0)', see `assume?` for more details) Is a positive, negative or zero?')
This is useful, but the traceback is not very interesting... I would like to be able to hide it.
Suggested solution
Allow the user to hide the traceback of a cell.
Alternative
No response
Additional context
No response
Maybe even better to show:
Value Error:
Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(a>0)', see `assume?` for more details) Is a positive, negative or zero?
Hi Eloitor, thanks for the feature request. We don't plan on letting users hide exceptions when editing a notebook -- we feel in general that exceptions mean that there's an error that should be brought to the user's attention. (When running a notebook with marimo run, exceptions are not shown).
If you'd like an exception to be hidden, you can catch it with a try/except.
Perhaps one thing we could do is let you temporarily collapse/expand the console output area, in which tracebacks are shown
Going to close this in favor of try/except