in transcoder/output/google_cloud/PubSubOutputManager.py [0:0]
def get_callback(publish_future: Future, data: str) -> Callable[[pubsub_v1.publisher.futures.Future], None]: # pylint: disable=unused-argument
"""PubSub future callback function used to log publishing errors"""
def callback(_publish_future: pubsub_v1.publisher.futures.Future) -> None:
try:
logging.debug(_publish_future.result())
except InvalidArgument as error:
logging.error(error)
except futures.TimeoutError:
logging.error('Publishing %s timed out.', data)
return callback