I have the following piece of code:
logger.info("Checkpoint 1")
try:
queue.push(item) # This is where the exception could occur
logger.info("Checkpoint 2")
except queues.errors.NotAllowedError as exc:
logger.info("Error 1")
raise exc
except Exception as e:
logger.info("Error 2")
finally:
logger.info("Checkpoint 3")
I’d expect either the program to print (if all goes well):
Checkpoint 1
Checkpoint 2
Checkpoint 3
And if it goes wrong it should for example print:
Checkpoint 1
Error 2
Checkpoint 3
But in my case my program prints out:
Checkpoint 1
Checkpoint 3
In what situation could this ever happen? Does Exception
not cover all exceptions that can happen?
4