module FakeAWS::S3::ErrorIndex

S3 error information, extracted from:

docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html

Public Class Methods

error_for_code(error_code) click to toggle source
# File lib/fake_aws/s3/error_index.rb, line 12
def self.error_for_code(error_code)
  errors[error_code] || raise(FakeAWS::UnknownResponseErrorCode)
end

Private Class Methods

errors() click to toggle source
# File lib/fake_aws/s3/error_index.rb, line 18
def self.errors
  @errors ||= {
    "NoSuchBucket" => Error.new(
      :description => "The specified bucket does not exist.",
      :status_code => 404
    ),
    "NoSuchKey" => Error.new(
      :description => "The specified key does not exist.",
      :status_code => 404
    ),
    "BucketAlreadyExists" => Error.new(
      :description => "The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.",
      :status_code => 409
    )
  }
end