You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Exception: Aws::Errors::ServiceError

Inherits:
RuntimeError
  • Object
show all
Defined in:
gems/aws-sdk-core/lib/aws-sdk-core/errors.rb

Overview

The base class for all errors returned by an Amazon Web Service. All ~400 level client errors and ~500 level server errors are raised as service errors. This indicates it was an error returned from the service and not one generated by the client.

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, message, data = Aws::EmptyStructure.new) ⇒ ServiceError

Returns a new instance of ServiceError

Parameters:



15
16
17
18
19
20
21
# File 'gems/aws-sdk-core/lib/aws-sdk-core/errors.rb', line 15

def initialize(context, message, data = Aws::EmptyStructure.new)
  @code = self.class.code
  @message = message if message && !message.empty?
  @context = context
  @data = data
  super(message)
end

Class Attribute Details

.codeString

Returns:

  • (String)


36
37
38
# File 'gems/aws-sdk-core/lib/aws-sdk-core/errors.rb', line 36

def code
  @code
end

Instance Attribute Details

#codeString (readonly)

Returns:

  • (String)


24
25
26
# File 'gems/aws-sdk-core/lib/aws-sdk-core/errors.rb', line 24

def code
  @code
end

#contextSeahorse::Client::RequestContext (readonly)

Returns The context of the request that triggered the remote service to return this error.

Returns:



28
29
30
# File 'gems/aws-sdk-core/lib/aws-sdk-core/errors.rb', line 28

def context
  @context
end

#dataAws::Structure (readonly)

Returns:

  • (Aws::Structure)


31
32
33
# File 'gems/aws-sdk-core/lib/aws-sdk-core/errors.rb', line 31

def data
  @data
end