{"action":"opened","issue":{"url":"https://api.github.com/repos/phpredis/phpredis/issues/662","labels_url":"https://api.github.com/repos/phpredis/phpredis/issues/662/labels{/name}","comments_url":"https://api.github.com/repos/phpredis/phpredis/issues/662/comments","events_url":"https://api.github.com/repos/phpredis/phpredis/issues/662/events","html_url":"https://github.com/phpredis/phpredis/issues/662","id":108155881,"number":662,"title":"Throw an exception when the subscribe method fail at some point","user":{"login":"zazabe","id":401598,"avatar_url":"https://avatars.githubusercontent.com/u/401598?v=3","gravatar_id":"","url":"https://api.github.com/users/zazabe","html_url":"https://github.com/zazabe","followers_url":"https://api.github.com/users/zazabe/followers","following_url":"https://api.github.com/users/zazabe/following{/other_user}","gists_url":"https://api.github.com/users/zazabe/gists{/gist_id}","starred_url":"https://api.github.com/users/zazabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zazabe/subscriptions","organizations_url":"https://api.github.com/users/zazabe/orgs","repos_url":"https://api.github.com/users/zazabe/repos","events_url":"https://api.github.com/users/zazabe/events{/privacy}","received_events_url":"https://api.github.com/users/zazabe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-24T15:34:26Z","updated_at":"2015-09-24T15:34:26Z","closed_at":null,"body":"We have an issue with the `subscribe` method, after a while, the method exit silently.\r\n\r\nWe investigate on our side and it seems that our callback is executed until the end but then, at the next message received by redis, one of the break condition in [generic_subscribe_cmd](https://github.com/phpredis/phpredis/blob/2.2.7/redis.c#L5544) seems to be true and the subscribe method just exit without any error.\r\n \r\nIt's not possible to catch this without debugging the extension itself because there's no exception thrown by phpredis when something wrong happen in the `while(1)` loop. \r\n\r\n- is there any reason for not throwing an exception instead of breaking the loop if phpredis [fail at some point in the while loop](https://github.com/phpredis/phpredis/blob/2.2.7/redis.c#L5672)?"}}