{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/1338","repository_url":"https://api.github.com/repos/aws/aws-sdk-ruby","labels_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/1338/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/1338/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/1338/events","html_url":"https://github.com/aws/aws-sdk-ruby/issues/1338","id":188113175,"number":1338,"title":"Aws::S3::Object#exists? doesn't return false if the object is missing, raises an error instead","user":{"login":"MaxPleaner","id":5035719,"avatar_url":"https://avatars.githubusercontent.com/u/5035719?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxPleaner","html_url":"https://github.com/MaxPleaner","followers_url":"https://api.github.com/users/MaxPleaner/followers","following_url":"https://api.github.com/users/MaxPleaner/following{/other_user}","gists_url":"https://api.github.com/users/MaxPleaner/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxPleaner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxPleaner/subscriptions","organizations_url":"https://api.github.com/users/MaxPleaner/orgs","repos_url":"https://api.github.com/users/MaxPleaner/repos","events_url":"https://api.github.com/users/MaxPleaner/events{/privacy}","received_events_url":"https://api.github.com/users/MaxPleaner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-08T21:50:17Z","updated_at":"2016-11-24T00:36:01Z","closed_at":null,"body":"I'd expect this method to simply return true/false depending on if the ~~bucket~~ (sorry, I meant to say **object**) exists.\r\n\r\nThe true case is working, but if I delete the bucket and try then I get a `Aws::S3::Errors::Forbidden` error, which I'm rescuing and treating like a false.\r\n\r\nHere's an excerpt of my code:\r\n\r\n```rb\r\ndef file_exists?(storage_key)\r\n  begin\r\n    Aws::S3::Resource.new(region: @region).bucket(@bucket).object(storage_key).exists?\r\n  rescue Aws::S3::Errors::Forbidden => e\r\n    false\r\n  end \r\nend\r\n```\r\n\r\nI'm pretty sure my permissions are fine because I've been doing various other kinds of S3 operations, including uploading, downloading, and deleting files.\r\n\r\nI'm not sure if this is the intended behavior and how long this behavior has been around (if it's been around a long time, changing it could break applications as I'm sure you know. )\r\n"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/comments/262663259","html_url":"https://github.com/aws/aws-sdk-ruby/issues/1338#issuecomment-262663259","issue_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/1338","id":262663259,"user":{"login":"awood45","id":2114465,"avatar_url":"https://avatars.githubusercontent.com/u/2114465?v=3","gravatar_id":"","url":"https://api.github.com/users/awood45","html_url":"https://github.com/awood45","followers_url":"https://api.github.com/users/awood45/followers","following_url":"https://api.github.com/users/awood45/following{/other_user}","gists_url":"https://api.github.com/users/awood45/gists{/gist_id}","starred_url":"https://api.github.com/users/awood45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awood45/subscriptions","organizations_url":"https://api.github.com/users/awood45/orgs","repos_url":"https://api.github.com/users/awood45/repos","events_url":"https://api.github.com/users/awood45/events{/privacy}","received_events_url":"https://api.github.com/users/awood45/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T00:36:01Z","updated_at":"2016-11-24T00:36:01Z","body":"Do you have permissions to the bucket? This error would indicate that the bucket exists but that you do not have access to it, or that the object exists and you don't have access to it.\r\n\r\nThere isn't a way to determine if an object you do not have access to exists."}}
{"actor":{"display_login":"awood45"}}