Exception: HaasbotRuby::RequestError
- Defined in:
- lib/haasbot_ruby/error.rb
Direct Known Subclasses
InvalidAccountGuid, InvalidBotElementGuid, InvalidBotGuid, InvalidEnum, InvalidMarket, InvalidParameter, InvalidRequest, InvalidSignature, MissingParameter, PriceMarketIsSyncing, PriceSourceNotActive, UnknownError
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
- #error_code ⇒ Object
-
#initialize(response = nil) ⇒ RequestError
constructor
A new instance of RequestError.
Constructor Details
#initialize(response = nil) ⇒ RequestError
Returns a new instance of RequestError.
8 9 10 |
# File 'lib/haasbot_ruby/error.rb', line 8 def initialize(response = nil) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/haasbot_ruby/error.rb', line 6 def response @response end |
Class Method Details
.error_from_code(code) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/haasbot_ruby/error.rb', line 12 def self.error_from_code(code) case code.to_i when 1001 InvalidRequest when 1002 InvalidSignature when 1003 InvalidBotGuid when 1004 InvalidBotElementGuid when 1005 InvalidAccountGuid when 1006 InvalidMarket when 1007 InvalidEnum when 1008 InvalidParameter when 1020 PriceSourceNotActive when 1021 PriceMarketIsSyncing when 1022 MissingParameter when 2000 UnknownError else UnknownError end end |
Instance Method Details
#error_code ⇒ Object
43 44 45 |
# File 'lib/haasbot_ruby/error.rb', line 43 def error_code response['ErrorCode'] end |