You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/10/12 14:47:19 UTC

[GitHub] dubee closed pull request #295: Treat malformed JSON as a string

dubee closed pull request #295: Treat malformed JSON as a string
URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/295
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/provider/consumer.py b/provider/consumer.py
index 9b48a2d..a061c86 100644
--- a/provider/consumer.py
+++ b/provider/consumer.py
@@ -477,6 +477,7 @@ def __encodeMessageIfNeeded(self, value):
             except ValueError:
                 # no big deal, just return the original value
                 logging.warn('[{}] I was asked to encode a message as JSON, but I failed.'.format(self.trigger))
+                value = "\"{}\"".format(value)
                 pass
         elif self.encodeValueAsBase64:
             try:


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services