{"action":"created","issue":{"url":"https://api.github.com/repos/gettyimages/gettyimages-api_ruby/issues/5","labels_url":"https://api.github.com/repos/gettyimages/gettyimages-api_ruby/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/gettyimages/gettyimages-api_ruby/issues/5/comments","events_url":"https://api.github.com/repos/gettyimages/gettyimages-api_ruby/issues/5/events","html_url":"https://github.com/gettyimages/gettyimages-api_ruby/pull/5","id":113757453,"number":5,"title":"Safer exception raising","user":{"login":"anathematic","id":28055,"avatar_url":"https://avatars.githubusercontent.com/u/28055?v=3","gravatar_id":"","url":"https://api.github.com/users/anathematic","html_url":"https://github.com/anathematic","followers_url":"https://api.github.com/users/anathematic/followers","following_url":"https://api.github.com/users/anathematic/following{/other_user}","gists_url":"https://api.github.com/users/anathematic/gists{/gist_id}","starred_url":"https://api.github.com/users/anathematic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anathematic/subscriptions","organizations_url":"https://api.github.com/users/anathematic/orgs","repos_url":"https://api.github.com/users/anathematic/repos","events_url":"https://api.github.com/users/anathematic/events{/privacy}","received_events_url":"https://api.github.com/users/anathematic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-28T07:05:41Z","updated_at":"2015-10-28T22:26:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/gettyimages/gettyimages-api_ruby/pulls/5","html_url":"https://github.com/gettyimages/gettyimages-api_ruby/pull/5","diff_url":"https://github.com/gettyimages/gettyimages-api_ruby/pull/5.diff","patch_url":"https://github.com/gettyimages/gettyimages-api_ruby/pull/5.patch"},"body":"Hi,\r\nI've had some issues integrating with this gem due to it's raising a general exception:\r\n\r\n```ruby\r\nif !resp.is_a?(Net::HTTPSuccess)\t\t\t\r\n  raise \"HTTP RESPONSE: #{resp}\" \r\nend\r\n```\r\n\r\nUsing a `raise` and hiding the errors under it makes it harder to catch the right errors:\r\n\r\n```ruby\r\nbegin\r\n  # Search Getty\r\nrescue\r\n  # I have no idea what I've just rescued\r\nend\r\n```\r\n\r\nvs. \r\n\r\n```ruby\r\nbegin\r\n  # Search Getty\r\nrescue Net::HTTPBadRequest\r\n  # I can tell everyone I've made a silly request\r\nend\r\n```\r\n\r\nI did have some issues getting the Cucumber specs up and running - if someone could point me in the right direction to get them going I'll give you a spec to match.\r\n\r\nThanks everyone!"},"comment":{"url":"https://api.github.com/repos/gettyimages/gettyimages-api_ruby/issues/comments/152016538","html_url":"https://github.com/gettyimages/gettyimages-api_ruby/pull/5#issuecomment-152016538","issue_url":"https://api.github.com/repos/gettyimages/gettyimages-api_ruby/issues/5","id":152016538,"user":{"login":"Sarukod","id":5098149,"avatar_url":"https://avatars.githubusercontent.com/u/5098149?v=3","gravatar_id":"","url":"https://api.github.com/users/Sarukod","html_url":"https://github.com/Sarukod","followers_url":"https://api.github.com/users/Sarukod/followers","following_url":"https://api.github.com/users/Sarukod/following{/other_user}","gists_url":"https://api.github.com/users/Sarukod/gists{/gist_id}","starred_url":"https://api.github.com/users/Sarukod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sarukod/subscriptions","organizations_url":"https://api.github.com/users/Sarukod/orgs","repos_url":"https://api.github.com/users/Sarukod/repos","events_url":"https://api.github.com/users/Sarukod/events{/privacy}","received_events_url":"https://api.github.com/users/Sarukod/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T22:26:34Z","updated_at":"2015-10-28T22:26:34Z","body":"Hi,\r\n\r\nTo make the Cucumber specs run:\r\n- if not installed, install the Cucumber gem\r\n  gem install cucumber\r\n- then you will to initialize the sub-modules for the features.\r\n - git submodule update --init --recursive\r\n\r\nThis should get the feature files and then you can run them.\r\n\r\nFor example:\r\nbundle exec cucumber features/authentication.feature -r features_step_definitions/step_definitions/authentication.feature.rb\r\n\r\nHope this helps.\r\n"}}