I have an API that raises ValueError():
def empty_string(foo):
if foo == '':
raise ValueError()
try:
foo = ''
empty_string(foo)
except ValueError as ex:
print(f"{ex}")
How do I print what function raised the error? I am not in a position to change the API and make the exception arg more informative.