I try to intercept exceptions in a Python Method without success.
The following code works well:
try:
a = int('a')
except:
return 'exception.'
but the next doesn't work:
try:
a = int('a')
except ValueError:
return 'exception'
How can I intercept a concrete exception?