Skip to content
This repository was archived by the owner on Jan 20, 2020. It is now read-only.

on_message Event handler uses "message" instead of "event" #23

Open
jyapayne opened this issue Jan 10, 2017 · 0 comments
Open

on_message Event handler uses "message" instead of "event" #23

jyapayne opened this issue Jan 10, 2017 · 0 comments

Comments

@jyapayne
Copy link

In the code below in events.py, I believe the line self.message_handler(message) should be changed to self.message_handler(event) because in my handler, I currently have to call json.loads() manually on the message.

...
    def _on_message(self, ws, message):
        logger.info("Websocket Message: %s" % message)
        try:
            event = json.loads(message)
        except ValueError:
            return
        if event.get("type") == "auth":
            return

        if self.message_handler:
            self.message_handler(message)
...
jyapayne pushed a commit to jyapayne/python-dockercloud that referenced this issue Jan 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant