-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stubbing :head_bucket
breaks bucket.exists?
#1289
Comments
Looking closer, it appears the stubbed response is a 400, while the actual one is a 404. Do I need to set the status code to 404 myself in the stub? The docs aren't clear on how to stub both a response error object and a status code. I would also expect the |
Identical to issue #1058 - your instinct is correct on this one. |
You can stub the status code as well, and doing that will give you the outcome you're looking for. |
Got it, thanks. Sorry for the dupe, I tried searching the issues, not far enough back I guess. I had also tried just |
No problem, sorry for the confusion! |
When I stub requests to
:head_bucket
with"NotFound"
, it causesbucket.exists?
to break.With a stubbed client, I get an exception:
When I try with a non-stubbed client, I get the same
Aws::S3::Errors::NotFound
error, but it returns false, rather than letting the exception bubble up:The difference appears to be that the stubbed response has the
stubbed-response-error-message
message, perhaps that's confusing the WaitOperations's rescue?The text was updated successfully, but these errors were encountered: