Exception: Apress::YandexMarket::Api::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Apress::YandexMarket::Api::Error
- Defined in:
- lib/apress/yandex_market/api/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(msg, code = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(msg, code = nil) ⇒ Error
Returns a new instance of Error.
7 8 9 10 11 12 13 14 15 |
# File 'lib/apress/yandex_market/api/error.rb', line 7 def initialize(msg, code = nil) @code = code.to_i = code ? "#{code} - #{msg}" : msg raise PageError.new() if msg.start_with? Api::PageError::MSG super .force_encoding('UTF-8') end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/apress/yandex_market/api/error.rb', line 5 def code @code end |