{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/329","labels_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/329/labels{/name}","comments_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/329/comments","events_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/329/events","html_url":"https://github.com/facebook/facebook-php-sdk-v4/issues/329","id":55444839,"number":329,"title":"Exception API broken with FacebookRequestException","user":{"login":"pugsley","id":2914944,"avatar_url":"https://avatars.githubusercontent.com/u/2914944?v=3","gravatar_id":"","url":"https://api.github.com/users/pugsley","html_url":"https://github.com/pugsley","followers_url":"https://api.github.com/users/pugsley/followers","following_url":"https://api.github.com/users/pugsley/following{/other_user}","gists_url":"https://api.github.com/users/pugsley/gists{/gist_id}","starred_url":"https://api.github.com/users/pugsley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pugsley/subscriptions","organizations_url":"https://api.github.com/users/pugsley/orgs","repos_url":"https://api.github.com/users/pugsley/repos","events_url":"https://api.github.com/users/pugsley/events{/privacy}","received_events_url":"https://api.github.com/users/pugsley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-26T03:58:40Z","updated_at":"2015-01-29T00:19:48Z","closed_at":null,"body":"I'm writing unit tests with Mockery to simulate Facebook SDK exceptions. However, the `FacebookRequestException` class breaks the PHP `Exception` API with the following constructor:\r\n\r\n```\r\npublic function __construct($rawResponse, $responseData, $statusCode)\r\n```\r\n\r\nThe standard Exception constructor looks like this:\r\n```\r\npublic function __construct($message = \"\", $code = 0, Exception $previous = null) { }\r\n```\r\n\r\nThis makes it especially hard to write test cases and I'm having to write an exception class wrapper that extends `FacebookRequestException`, corrects the constructor API then recalls `FacebookRequestException->__construct` = yuck! Maybe FacebookRequestException could be created in a factory or receive the extra parameters as a 4th parameter.\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/comments/71945251","html_url":"https://github.com/facebook/facebook-php-sdk-v4/issues/329#issuecomment-71945251","issue_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/329","id":71945251,"user":{"login":"pugsley","id":2914944,"avatar_url":"https://avatars.githubusercontent.com/u/2914944?v=3","gravatar_id":"","url":"https://api.github.com/users/pugsley","html_url":"https://github.com/pugsley","followers_url":"https://api.github.com/users/pugsley/followers","following_url":"https://api.github.com/users/pugsley/following{/other_user}","gists_url":"https://api.github.com/users/pugsley/gists{/gist_id}","starred_url":"https://api.github.com/users/pugsley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pugsley/subscriptions","organizations_url":"https://api.github.com/users/pugsley/orgs","repos_url":"https://api.github.com/users/pugsley/repos","events_url":"https://api.github.com/users/pugsley/events{/privacy}","received_events_url":"https://api.github.com/users/pugsley/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T00:19:48Z","updated_at":"2015-01-29T00:19:48Z","body":"Sounds good, if I have some time after that I'll see what I can do."}}