Don't trigger error_callback for known exc
When AMQPDestinationNotFound is raised, we must not call the error_callback method. The exception is logged only if needed in upper layer (amqpdriver.py). Related-bug: #1524418 Related-bug: #1521958 (cherry picked from commit Ic1ddec2d13172532dbaa572d04a4c22c97ac4fe7) Change-Id: I4bc323f0b9578cfd4972f882d6fbf59b9064ca53
This commit is contained in:
parent
53256e990d
commit
8093aefaae
|
@ -256,3 +256,7 @@ def _add_unique_id(msg):
|
|||
unique_id = uuid.uuid4().hex
|
||||
msg.update({UNIQUE_ID: unique_id})
|
||||
LOG.debug('UNIQUE_ID is %s.', unique_id)
|
||||
|
||||
|
||||
class AMQPDestinationNotFound(Exception):
|
||||
pass
|
||||
|
|
|
@ -878,6 +878,10 @@ class Connection(object):
|
|||
'retry': retry}
|
||||
LOG.error(msg)
|
||||
raise exceptions.MessageDeliveryFailure(msg)
|
||||
except rpc_amqp.AMQPDestinationNotFound:
|
||||
# NOTE(sileht): we must reraise this without
|
||||
# trigger error_callback
|
||||
raise
|
||||
except Exception as exc:
|
||||
error_callback and error_callback(exc)
|
||||
raise
|
||||
|
|
Loading…
Reference in New Issue