{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/influxdb-php/issues/54","repository_url":"https://api.github.com/repos/influxdata/influxdb-php","labels_url":"https://api.github.com/repos/influxdata/influxdb-php/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/influxdb-php/issues/54/comments","events_url":"https://api.github.com/repos/influxdata/influxdb-php/issues/54/events","html_url":"https://github.com/influxdata/influxdb-php/issues/54","id":166117070,"number":54,"title":"Better exception class naming","user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-18T15:10:26Z","updated_at":"2016-07-18T15:54:48Z","closed_at":null,"body":"All exception classes of this library are named `Exception`.\r\n\r\nIf we import one of them, the code looks like:\r\n\r\n```php\r\n        try {\r\n            $stats = $this->get('influx.wrapper')->getLastServerStat($server->getCompleteName());\r\n        } catch (Exception $e) {\r\n            \r\n        }\r\n```\r\n\r\nHard to see at the first move the exception is talking about query, database or whatever.\r\n\r\nHaving `QueryException` for example would be a good start.\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/influxdata/influxdb-php/issues/comments/233371816","html_url":"https://github.com/influxdata/influxdb-php/issues/54#issuecomment-233371816","issue_url":"https://api.github.com/repos/influxdata/influxdb-php/issues/54","id":233371816,"user":{"login":"greg0ire","id":657779,"avatar_url":"https://avatars.githubusercontent.com/u/657779?v=3","gravatar_id":"","url":"https://api.github.com/users/greg0ire","html_url":"https://github.com/greg0ire","followers_url":"https://api.github.com/users/greg0ire/followers","following_url":"https://api.github.com/users/greg0ire/following{/other_user}","gists_url":"https://api.github.com/users/greg0ire/gists{/gist_id}","starred_url":"https://api.github.com/users/greg0ire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg0ire/subscriptions","organizations_url":"https://api.github.com/users/greg0ire/orgs","repos_url":"https://api.github.com/users/greg0ire/repos","events_url":"https://api.github.com/users/greg0ire/events{/privacy}","received_events_url":"https://api.github.com/users/greg0ire/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T15:54:48Z","updated_at":"2016-07-18T15:54:48Z","body":"> In any way, we both agree for the Exception custom naming.\r\n\r\nIndeed, it must be changed.\r\n\r\n> It's the way used by many libraries/framework. Symfony for example follow this method.\r\n\r\nThat's [a fallacy](https://yourlogicalfallacyis.com/bandwagon).\r\n\r\n> I think it easier to see what we are using with Interface or Exception suffixes.\r\n\r\nFor interface, I'd argue that you shouldn't care if you are type hinting against a class or an interface, it's not the concern of the consuming code, it's an implementation detail.\r\n\r\nFor exceptions, I'll just parrot the video : \"when do you not know it's an exception?\". Indeed, the `catch` and `throw` keywords are already sufficient to ensure that.\r\n\r\nor interfaces, you shouldn't care, because whether you are type hinting against a class or an interface should be just an implementation detail."}}
{"actor":{"display_login":"greg0ire"}}