Class: Aws::S3::Errors::Http301Error

Inherits:
ServiceError
  • Object
show all
Defined in:
lib/aws-sdk-s3/customizations/errors.rb

Overview

Hijack PermanentRedirect (HeadBucket case - no body) dynamic error to include the region.

Instance Method Summary collapse

Constructor Details

#initialize(context, message, _data = Aws::EmptyStructure.new) ⇒ Http301Error

Returns a new instance of Http301Error.

Parameters:



32
33
34
35
36
# File 'lib/aws-sdk-s3/customizations/errors.rb', line 32

def initialize(context, message, _data = Aws::EmptyStructure.new)
  data = Aws::S3::Types::PermanentRedirect.new(message: message)
  data.region = context.http_response.headers['x-amz-bucket-region']
  super(context, message, data)
end