class AliyunSDK::STS::ServerError
ServerError
represents exceptions from the STS
service. i.e. Client
receives a HTTP response whose status is NOT OK. message
provides the error message and to_s
gives detailed information probably including the STS
request id.
Attributes
error_code[R]
http_code[R]
message[R]
request_id[R]
Public Class Methods
new(response)
click to toggle source
# File lib/aliyun_sdk/sts/exception.rb, line 15 def initialize(response) @http_code = response.code @attrs = {} doc = Nokogiri::XML(response.body) do |config| config.options |= Nokogiri::XML::ParseOptions::NOBLANKS end rescue nil if doc and doc.root doc.root.children.each do |n| @attrs[n.name] = n.text end end @error_code = @attrs['Code'] @message = @attrs['Message'] @request_id = @attrs['RequestId'] end
Public Instance Methods
to_s()
click to toggle source
# File lib/aliyun_sdk/sts/exception.rb, line 39 def to_s @attrs.merge({'HTTPCode' => @http_code}).map do |k, v| [k, v].join(": ") end.join(", ") end