lpython icon indicating copy to clipboard operation
lpython copied to clipboard

`TypeError` does not print the message

Open ubaidsk opened this issue 1 year ago • 1 comments

% cat examples/expr2.py                           
raise TypeError("Some error")
% python examples/expr2.py
Traceback (most recent call last):
  File "/Users/ubaid/Desktop/OpenSource/lpython/examples/expr2.py", line 1, in <module>
    raise TypeError("Some error")
TypeError: Some error
% lpython examples/expr2.py
ERROR STOP

ASR::ErrorStop has an argument to print the message, so we should put the message during AST->ASR in that appropriate argument.

ubaidsk avatar Apr 26 '24 02:04 ubaidsk

@Shaikh-Ubaid this bug exists for all the builtin exceptions like ValueError, ZeroDivisionError, etc.

kmr-srbh avatar Apr 26 '24 10:04 kmr-srbh