lib/aws-sdk-applicationinsights/errors.rb in aws-sdk-applicationinsights-1.6.0 vs lib/aws-sdk-applicationinsights/errors.rb in aws-sdk-applicationinsights-1.7.0
- old
+ new
@@ -4,10 +4,39 @@
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::ApplicationInsights
+
+ # When ApplicationInsights returns an error response, the Ruby SDK constructs and raises an error.
+ # These errors all extend Aws::ApplicationInsights::Errors::ServiceError < {Aws::Errors::ServiceError}
+ #
+ # You can rescue all ApplicationInsights errors using ServiceError:
+ #
+ # begin
+ # # do stuff
+ # rescue Aws::ApplicationInsights::Errors::ServiceError
+ # # rescues all ApplicationInsights 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
+ # * {BadRequestException}
+ # * {InternalServerException}
+ # * {ResourceInUseException}
+ # * {ResourceNotFoundException}
+ # * {TagsAlreadyExistException}
+ # * {TooManyTagsException}
+ # * {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 BadRequestException < ServiceError
@@ -21,11 +50,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class InternalServerException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -37,11 +65,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class ResourceInUseException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -53,11 +80,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class ResourceNotFoundException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -69,11 +95,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class TagsAlreadyExistException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -85,11 +110,10 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
class TooManyTagsException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -106,11 +130,10 @@
# @return [String]
def resource_name
@data[:resource_name]
end
-
end
class ValidationException < ServiceError
# @param [Seahorse::Client::RequestContext] context
@@ -122,10 +145,9 @@
# @return [String]
def message
@message || @data[:message]
end
-
end
end
end