While executing a try except process, I get different types of exceptions, there is one exactly that I want the process to act different than with the others.
This is my process, as simple as that:
try:
variable = do_something()
except Exception as e:
print(e)
continue
It catches different types of exceptions during the process, but the exact exception I want to address differently is:
Message: invalid session id
Stacktrace:
#0 0x56107b4a8e89 <unknown>
I am thinking on addressing the following way:
if 'invalid session id' in str(e):
print('passing')
pass
But I would like to know if there is a more elegant of pythonic way to do it