lib/aws-sdk-cloudwatch/errors.rb in aws-sdk-cloudwatch-1.33.0 vs lib/aws-sdk-cloudwatch/errors.rb in aws-sdk-cloudwatch-1.34.0
- old
+ new
@@ -4,10 +4,45 @@
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::CloudWatch
+
+ # When CloudWatch returns an error response, the Ruby SDK constructs and raises an error.
+ # These errors all extend Aws::CloudWatch::Errors::ServiceError < {Aws::Errors::ServiceError}
+ #
+ # You can rescue all CloudWatch errors using ServiceError:
+ #
+ # begin
+ # # do stuff
+ # rescue Aws::CloudWatch::Errors::ServiceError
+ # # rescues all CloudWatch 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
+ # * {ConcurrentModificationException}
+ # * {DashboardInvalidInputError}
+ # * {DashboardNotFoundError}
+ # * {InternalServiceFault}
+ # * {InvalidFormatFault}
+ # * {InvalidNextToken}
+ # * {InvalidParameterCombinationException}
+ # * {InvalidParameterValueException}
+ # * {LimitExceededException}
+ # * {LimitExceededFault}
+ # * {MissingRequiredParameterException}
+ # * {ResourceNotFound}
+ # * {ResourceNotFoundException}
+ #
+ # 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 ConcurrentModificationException < ServiceError
@@ -16,11 +51,10 @@
# @param [String] message
# @param [Aws::CloudWatch::Types::ConcurrentModificationException] data
def initialize(context, message, data = Aws::EmptyStructure.new)
super(context, message, data)
end
-
end
class DashboardInvalidInputError < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -37,11 +71,10 @@
# @return [String]
def dashboard_validation_messages
@data[:dashboard_validation_messages]
end
-
end
class DashboardNotFoundError < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -53,11 +86,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class InternalServiceFault < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -69,11 +101,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class InvalidFormatFault < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -85,11 +116,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class InvalidNextToken < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -101,11 +131,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class InvalidParameterCombinationException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -117,11 +146,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class InvalidParameterValueException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -133,22 +161,20 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class LimitExceededException < ServiceError
# @param [Seahorse::Client::RequestContext] context
# @param [String] message
# @param [Aws::CloudWatch::Types::LimitExceededException] data
def initialize(context, message, data = Aws::EmptyStructure.new)
super(context, message, data)
end
-
end
class LimitExceededFault < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -160,11 +186,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class MissingRequiredParameterException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -176,11 +201,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class ResourceNotFound < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -192,11 +216,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class ResourceNotFoundException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -213,10 +236,9 @@
# @return [String]
def resource_id
@data[:resource_id]
end
-
end
end
end