Class: Aws::Plugins::S3Http200Errors::Handler Private
- Inherits:
-
Seahorse::Client::Handler
- Object
- Seahorse::Client::Handler
- Aws::Plugins::S3Http200Errors::Handler
- Defined in:
- lib/aws-sdk-core/plugins/s3_http_200_errors.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Handler
Instance Method Summary collapse
- #call(context) ⇒ Object private
- #check_for_error(context) ⇒ Object private
Methods inherited from Seahorse::Client::Handler
Constructor Details
This class inherits a constructor from Seahorse::Client::Handler
Instance Method Details
#call(context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 16 17 18 19 20 21 |
# File 'lib/aws-sdk-core/plugins/s3_http_200_errors.rb', line 13 def call(context) @handler.call(context).on(200) do |response| if error = check_for_error(context) context.http_response.status_code = 500 response.data = nil response.error = error end end end |
#check_for_error(context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 26 27 28 29 30 |
# File 'lib/aws-sdk-core/plugins/s3_http_200_errors.rb', line 23 def check_for_error(context) xml = context.http_response.body_contents if xml.match(/<Error>/) error_code = xml.match(/<Code>(.+?)<\/Code>/)[1] = xml.match(/<Message>(.+?)<\/Message>/)[1] S3::Errors.error_class(error_code).new(context, ) end end |