{"action":"created","issue":{"url":"https://api.github.com/repos/andymccurdy/redis-py/issues/752","repository_url":"https://api.github.com/repos/andymccurdy/redis-py","labels_url":"https://api.github.com/repos/andymccurdy/redis-py/issues/752/labels{/name}","comments_url":"https://api.github.com/repos/andymccurdy/redis-py/issues/752/comments","events_url":"https://api.github.com/repos/andymccurdy/redis-py/issues/752/events","html_url":"https://github.com/andymccurdy/redis-py/pull/752","id":159853816,"number":752,"title":"pubsub: improve error reporting if caller forgets to subscribe (issue #716)","user":{"login":"gward","id":51437,"avatar_url":"https://avatars.githubusercontent.com/u/51437?v=3","gravatar_id":"","url":"https://api.github.com/users/gward","html_url":"https://github.com/gward","followers_url":"https://api.github.com/users/gward/followers","following_url":"https://api.github.com/users/gward/following{/other_user}","gists_url":"https://api.github.com/users/gward/gists{/gist_id}","starred_url":"https://api.github.com/users/gward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gward/subscriptions","organizations_url":"https://api.github.com/users/gward/orgs","repos_url":"https://api.github.com/users/gward/repos","events_url":"https://api.github.com/users/gward/events{/privacy}","received_events_url":"https://api.github.com/users/gward/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-12T23:20:26Z","updated_at":"2016-06-13T07:33:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/andymccurdy/redis-py/pulls/752","html_url":"https://github.com/andymccurdy/redis-py/pull/752","diff_url":"https://github.com/andymccurdy/redis-py/pull/752.diff","patch_url":"https://github.com/andymccurdy/redis-py/pull/752.patch"},"body":"This is an easy mistake to make -- at least, I keep making it. It\r\nformerly resulted in a confusing crash, \"AttributeError: 'NoneType'\r\nobject has no attribute 'can_read'\", from parse_response(). I have had\r\nto dig into the redis-py source code more than once to figure out what\r\nwent wrong.\r\n\r\nWith this patch, it still crashes, but with a clearer error that\r\nclarifies what the calling code forgot to do.\r\n\r\nFixes issue #716."},"comment":{"url":"https://api.github.com/repos/andymccurdy/redis-py/issues/comments/225507914","html_url":"https://github.com/andymccurdy/redis-py/pull/752#issuecomment-225507914","issue_url":"https://api.github.com/repos/andymccurdy/redis-py/issues/752","id":225507914,"user":{"login":"carltongibson","id":64686,"avatar_url":"https://avatars.githubusercontent.com/u/64686?v=3","gravatar_id":"","url":"https://api.github.com/users/carltongibson","html_url":"https://github.com/carltongibson","followers_url":"https://api.github.com/users/carltongibson/followers","following_url":"https://api.github.com/users/carltongibson/following{/other_user}","gists_url":"https://api.github.com/users/carltongibson/gists{/gist_id}","starred_url":"https://api.github.com/users/carltongibson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carltongibson/subscriptions","organizations_url":"https://api.github.com/users/carltongibson/orgs","repos_url":"https://api.github.com/users/carltongibson/repos","events_url":"https://api.github.com/users/carltongibson/events{/privacy}","received_events_url":"https://api.github.com/users/carltongibson/received_events","type":"User","site_admin":false},"created_at":"2016-06-13T07:33:28Z","updated_at":"2016-06-13T07:33:28Z","body":"@andymccurdy In that case I'm inclined towards using an `assert`... \r\n\r\n```\r\nconnection = self.connection\r\nassert connection is not None, \"connection not set: did you forget to call subscribe() or psubscribe()?\"\r\n```\r\n\r\nCrash hard. :-)"}}
{"actor":{"display_login":"carltongibson"}}