Open this example in the interactive library
Source code
try:
try:
int('x')
except ValueError as error:
raise RuntimeError('Invalid input') from error
except RuntimeError as error:
print(type(error.__cause__).__name__)Sample output
ValueError
