Python - Advanced Exception Handling
You want to write a function that reads a number from a string and raises a custom MyError if conversion fails, but also keep the original error for debugging. Which code correctly implements exception chaining?
class MyError(Exception):
pass
def read_number(s):
try:
return int(s)
except ValueError as e:
???