Sha256: 10aac063c474c2bd4a93f4540a2fece3f1e287e8dd0c784c4ebb2635354a5d55
Contents?: true
Size: 953 Bytes
Versions: 23
Compression:
Stored size: 953 Bytes
Contents
# frozen_string_literal: true module Aws module S3 module Errors # Hijack PermanentRedirect dynamic error to also include endpoint # and bucket. class PermanentRedirect < ServiceError # @param [Seahorse::Client::RequestContext] context # @param [String] message # @param [Aws::S3::Types::PermanentRedirect] _data def initialize(context, message, _data = Aws::EmptyStructure.new) data = Aws::S3::Types::PermanentRedirect.new(message: message) body = context.http_response.body_contents if (endpoint = body.match(/<Endpoint>(.+?)<\/Endpoint>/)) data.endpoint = endpoint[1] end if (bucket = body.match(/<Bucket>(.+?)<\/Bucket>/)) data.bucket = bucket[1] end data.region = context.http_response.headers['x-amz-bucket-region'] super(context, message, data) end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems