From 46ac91e63ed39ec575b1b4a9f47becc87eb80511 Mon Sep 17 00:00:00 2001 From: Alexey Lebedeff <alebedev@mirantis.com> Date: Tue, 24 Nov 2015 14:57:24 +0300 Subject: [PATCH] Provide missing parts of error messages Change-Id: I8ccb8a4979ec78b7f87d32d455265eeb57ed442f --- .../_drivers/pika_driver/pika_message.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/oslo_messaging/_drivers/pika_driver/pika_message.py b/oslo_messaging/_drivers/pika_driver/pika_message.py index da87c7d01..b08288c71 100644 --- a/oslo_messaging/_drivers/pika_driver/pika_message.py +++ b/oslo_messaging/_drivers/pika_driver/pika_message.py @@ -54,8 +54,12 @@ class PikaIncomingMessage(object): ) if self.content_type != "application/json": - raise NotImplementedError("Content-type['{}'] is not valid, " - "'application/json' only is supported.") + raise NotImplementedError( + "Content-type['{}'] is not valid, " + "'application/json' only is supported.".format( + self.content_type + ) + ) message_dict = common.deserialize_msg( jsonutils.loads(body, encoding=self.content_encoding) @@ -159,8 +163,12 @@ class PikaOutgoingMessage(object): self.content_encoding = content_encoding if self.content_type != "application/json": - raise NotImplementedError("Content-type['{}'] is not valid, " - "'application/json' only is supported.") + raise NotImplementedError( + "Content-type['{}'] is not valid, " + "'application/json' only is supported.".format( + self.content_type + ) + ) self.message = message self.context = context