Raising a` BoxExpressionError` is not handled properly?
rocky opened this issue · comments
Description
A BoxExpressionError
does not seem to be handled properly.
How to Reproduce
Evaluate in Django or mathicsscript
Graphics3D[Cylinder[0]]
Output Given
Traceback (most recent call last):
...
File "Mathics3/mathics-core/mathics/builtin/box/expression.py", line 51, in __new__
instance = super().__new__(cls, *elements, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Mathics3/mathics-core/mathics/core/builtin.py", line 465, in __new__
instance.init(*args, **kwargs)
File 'Mathics3/mathics-core/mathics/builtin/box/graphics3d.py", line 602, in init
raise BoxExpressionError
mathics.core.exceptions.BoxExpressionError
Expected behavior
Actually, I do not know what is expected. I know that an uncaught exception is not expected. In mathicsscript
or mathics
, this terminates the session.
Your Environment
All environments.
Additional context
Noticed in testing out things for a possible new release.
I can make a stab at addressing, but I am at a loss for what the right behavior is.
For Graphics3D[Sphere[1, 0, 1]]
I have turned this into a Syntax error giving:
mathics.core.exceptions.BoxExpressionError: In Sphere[], expecting 2 elements: point(s) and radius, got 3.
but I don't know if this is right.
This issue handled, although the specific case Graphics3D[Cylinder[0]]
is not. #970 is the follow on.