Stubbing nil
response in Aws::S3::Client.stub_responses throws unhandled exception
#3210
Open
1 task done
Labels
wontfix
We have determined that we will not resolve the issue.
Describe the bug
If an S3 endpoint is stubbed out from the client via
stub_responses
with aProc
, any value ofcontext
that results in theProc
returningnil
will throw an error:It appears to be related to #3204 as the behavior changes when upgrading
aws-sdk-s3
from0.1.181 -> 0.1.182
. It appears that before this PR,nil
was handled separately fromHash
-- with this change, we can end up passingnil
toParamsValidator.validate!
which causes the unhandled exceptionRegression Issue
Expected Behavior
exists?
function returnsfalse
instead of throwing an unhandled exceptionCurrent Behavior
Throws unhandled exception. Here is a stack trace.
Reproduction Steps
This also repros if you replace the stub with the following (though admittedly this example may be less motivating)
Possible Solution
It appears to be related to #3204 as the behavior changes when upgrading
aws-sdk-s3
from0.1.181 -> 0.1.182
. It appears that before this PR,nil
was handled separately fromHash
-- with this change, we can end up passingnil
toParamsValidator.validate!
which causes the unhandled exception.Perhaps something like this? Or adding an explicit branch to handle
stub
beingnil
Additional Information/Context
While I think I'd prefer a solution that handles
nil
, I think an exception that points to the issue a bit more directly would be very helpful! It took us a while to sort this out as the underlying issue on a version upgrade.Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-s3 0.1.182
Environment details (Version of Ruby, OS environment)
Ruby 3.3.5, maxOS Sequoia 15.2 (M2 CPU)
The text was updated successfully, but these errors were encountered: