class HaasbotRuby::RequestError
Attributes
response[R]
Public Class Methods
error_from_code(code)
click to toggle source
# 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
new(response = nil)
click to toggle source
# File lib/haasbot_ruby/error.rb, line 8 def initialize(response = nil) @response = response end
Public Instance Methods
error_code()
click to toggle source
# File lib/haasbot_ruby/error.rb, line 43 def error_code response['ErrorCode'] end