_MissingRequiredTransaction, _UnexpectedOpenTransaction and _UnexpectedDanglingTransaction are all designed to not be caught. But they are subclasses of Exception, which means that an except Exception: catchall block will catch and potentially swallow them. Using BaseException as the parent class instead will avoid this problem.