Exception: Mws::Errors::ServerError

Inherits:
Error
  • Object
show all
Defined in:
lib/mws/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ServerError

Returns a new instance of ServerError.



11
12
13
14
15
16
17
18
19
20
# File 'lib/mws/errors.rb', line 11

def initialize(options)
  @type = options[:type] || 'HTTP'
  @code = options[:code]
  @message = options[:message]
  @details = options[:details] || options[:detail] 
  if @details.nil? or @details.empty?
    @details = 'None'
  end
  super "Type: #{@type}, Code: #{@code}, Message: #{@message}, Details: #{@details}"
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



9
10
11
# File 'lib/mws/errors.rb', line 9

def code
  @code
end

#detailsObject (readonly)

Returns the value of attribute details.



9
10
11
# File 'lib/mws/errors.rb', line 9

def details
  @details
end

#messageObject (readonly)

Returns the value of attribute message.



9
10
11
# File 'lib/mws/errors.rb', line 9

def message
  @message
end

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/mws/errors.rb', line 9

def type
  @type
end