kevincalori
Posts2Registration dateFriday 9 August 2024StatusMemberLast seen27 August 2024
-
27 Aug 2024 à 07:08
Hello everyone,
I am facing a problem with my Python script when trying to handle exceptions. I am using a try/except block to catch errors; but instead of catching the specific exception I am expecting, the script seems to bypass the block entirely and raises an unhandled exception.
try:
# Some operation that could raise an error
result = my_function()
except ValueError as e:
print(f"ValueError caught: {e}")
Despite expecting a ValueError, I get an error message like this: