I have a code sample below, where I want to catch some exception:
in the main function:
try:
...
do_something()
except some_exception,e:
do_some_other_thing
in the do_something function
try:
...
except some_exception,e:
do_some_other_thing
So when I was testing it, I noticed that the exception was handled twice (once in do_somthing(), and once in the main function), is my observation accurate?
Is there a way to catch the exception that are only not captured by its function? Because there are two scenarios that I want to catch and they are somewhat wrapped into the same exception handling class(i.e. some_exception)