Exception: Aws::AwsError2

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/awsbase/right_awsbase.rb

Overview

Simplified version

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_code = nil, request_id = nil, request_data = nil, response = nil) ⇒ AwsError2

Returns a new instance of AwsError2.



838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
# File 'lib/awsbase/right_awsbase.rb', line 838

def initialize(http_code=nil, request_id=nil, request_data=nil, response=nil)

    @request_id   = request_id
    @http_code    = http_code
    @request_data = request_data
    @response     = response
#            puts '@response=' + @response.inspect

    if @response
        ref = XmlSimple.xml_in(@response, {"ForceArray"=>false})
#                puts "refxml=" + ref.inspect
        msg = "#{ref['Error']['Code']}: #{ref['Error']['Message']}"
    else
        msg = "#{@http_code}: REQUEST(#{@request_data})"
    end
    msg += "\nREQUEST ID=#{@request_id} " unless @request_id.nil?
    super(msg)
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



836
837
838
# File 'lib/awsbase/right_awsbase.rb', line 836

def errors
  @errors
end

#http_codeObject (readonly)

Response HTTP error code



829
830
831
# File 'lib/awsbase/right_awsbase.rb', line 829

def http_code
  @http_code
end

#request_dataObject (readonly)

Raw request text data to AWS



832
833
834
# File 'lib/awsbase/right_awsbase.rb', line 832

def request_data
  @request_data
end

#request_idObject (readonly)

Request id (if exists)



826
827
828
# File 'lib/awsbase/right_awsbase.rb', line 826

def request_id
  @request_id
end

#responseObject (readonly)

Returns the value of attribute response.



834
835
836
# File 'lib/awsbase/right_awsbase.rb', line 834

def response
  @response
end