fix: raise BrokenPipeError (#1231)

Co-authored-by: Steven Joseph <steven@pointzi.com>
Co-authored-by: Steven Joseph <steven@stevenjoseph.in>
This commit is contained in:
Steven 2021-08-26 23:16:24 +10:00 committed by GitHub
parent 39584a1940
commit cad7a88b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -126,6 +126,10 @@ class Message:
def ack_log_error(self, logger, errors, multiple=False):
try:
self.ack(multiple=multiple)
except BrokenPipeError as exc:
logger.critical("Couldn't ack %r, reason:%r",
self.delivery_tag, exc, exc_info=True)
raise
except errors as exc:
logger.critical("Couldn't ack %r, reason:%r",
self.delivery_tag, exc, exc_info=True)