lib/aws-sdk-emr/errors.rb in aws-sdk-emr-1.24.0 vs lib/aws-sdk-emr/errors.rb in aws-sdk-emr-1.25.0
- old
+ new
@@ -4,14 +4,49 @@
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::EMR
+
+ # When EMR returns an error response, the Ruby SDK constructs and raises an error.
+ # These errors all extend Aws::EMR::Errors::ServiceError < {Aws::Errors::ServiceError}
+ #
+ # You can rescue all EMR errors using ServiceError:
+ #
+ # begin
+ # # do stuff
+ # rescue Aws::EMR::Errors::ServiceError
+ # # rescues all EMR 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
+ # * {InternalServerError}
+ # * {InternalServerException}
+ # * {InvalidRequestException}
+ #
+ # 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 InternalServerError < ServiceError
+
+ # @param [Seahorse::Client::RequestContext] context
+ # @param [String] message
+ # @param [Aws::EMR::Types::InternalServerError] data
+ def initialize(context, message, data = Aws::EmptyStructure.new)
+ super(context, message, data)
+ end
+ end
+
class InternalServerException < ServiceError
# @param [Seahorse::Client::RequestContext] context
# @param [String] message
# @param [Aws::EMR::Types::InternalServerException] data
@@ -21,11 +56,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class InvalidRequestException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -42,10 +76,9 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
end
end