lib/aws-sdk-cloudsearch/errors.rb in aws-sdk-cloudsearch-1.17.0 vs lib/aws-sdk-cloudsearch/errors.rb in aws-sdk-cloudsearch-1.18.0

- old
+ new

@@ -4,10 +4,39 @@ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::CloudSearch + + # When CloudSearch returns an error response, the Ruby SDK constructs and raises an error. + # These errors all extend Aws::CloudSearch::Errors::ServiceError < {Aws::Errors::ServiceError} + # + # You can rescue all CloudSearch errors using ServiceError: + # + # begin + # # do stuff + # rescue Aws::CloudSearch::Errors::ServiceError + # # rescues all CloudSearch API errors + # end + # + # + # ## Request Context + # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns + # information about the request that generated the error. + # See {Seahorse::Client::RequestContext} for more information. + # + # ## Error Classes + # * {BaseException} + # * {DisabledOperationException} + # * {InternalException} + # * {InvalidTypeException} + # * {LimitExceededException} + # * {ResourceNotFoundException} + # * {ValidationException} + # + # Additionally, error classes are dynamically generated for service errors based on the error code + # if they are not defined above. module Errors extend Aws::Errors::DynamicErrors class BaseException < ServiceError @@ -26,10 +55,69 @@ # @return [String] def message @message || @data[:message] end + end + class DisabledOperationException < ServiceError + + # @param [Seahorse::Client::RequestContext] context + # @param [String] message + # @param [Aws::CloudSearch::Types::DisabledOperationException] data + def initialize(context, message, data = Aws::EmptyStructure.new) + super(context, message, data) + end + end + + class InternalException < ServiceError + + # @param [Seahorse::Client::RequestContext] context + # @param [String] message + # @param [Aws::CloudSearch::Types::InternalException] data + def initialize(context, message, data = Aws::EmptyStructure.new) + super(context, message, data) + end + end + + class InvalidTypeException < ServiceError + + # @param [Seahorse::Client::RequestContext] context + # @param [String] message + # @param [Aws::CloudSearch::Types::InvalidTypeException] data + def initialize(context, message, data = Aws::EmptyStructure.new) + super(context, message, data) + end + end + + class LimitExceededException < ServiceError + + # @param [Seahorse::Client::RequestContext] context + # @param [String] message + # @param [Aws::CloudSearch::Types::LimitExceededException] data + def initialize(context, message, data = Aws::EmptyStructure.new) + super(context, message, data) + end + end + + class ResourceNotFoundException < ServiceError + + # @param [Seahorse::Client::RequestContext] context + # @param [String] message + # @param [Aws::CloudSearch::Types::ResourceNotFoundException] data + def initialize(context, message, data = Aws::EmptyStructure.new) + super(context, message, data) + end + end + + class ValidationException < ServiceError + + # @param [Seahorse::Client::RequestContext] context + # @param [String] message + # @param [Aws::CloudSearch::Types::ValidationException] data + def initialize(context, message, data = Aws::EmptyStructure.new) + super(context, message, data) + end end end end