Exception: FoundationApi::JsonRPC::JsonRPCError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/foundation_api/json_rpc/exceptions.rb

Constant Summary collapse

RESPONSES =
[:no_error                     ,
:invalid_security_token        ,
:invalid_user_or_pass          ,
:exception_thrown              ,
:not_implemented               ,
:incorrect_parameter_list      ,
:missing_player_session        ,
:unable_to_get_session_lock    ,
:session_server_fault          ,
:insufficient_privileges       ,
:incorrect_account_format      ,
:invalid_parameter             ,  # 11
:unknown_player_attribute      ,  # 12
:cannot_set_readonly_attribute ,  # 13
:duplicate_attribute_value     ,  # 14
:unknown_player_flag           ,  # 15
:cannot_set_readonly_flag      ,  # 16
:nothing_to_update             ,  # 17
:unknown_error                 ,  # 18
:mismatching_transactions      ,  # 19
:db_error                      ,  # 20
:un_identified_error_21        ,  # 21
:un_identified_error_22        ,  # 22
:un_identified_error_23        ,  # 23
:insufficient_funds            
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code = nil) ⇒ JsonRPCError

Returns a new instance of JsonRPCError.



34
35
36
# File 'lib/foundation_api/json_rpc/exceptions.rb', line 34

def initialize(code = nil)
  @code = code.to_i if code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



33
34
35
# File 'lib/foundation_api/json_rpc/exceptions.rb', line 33

def code
  @code
end

Instance Method Details

#responseObject



38
39
40
# File 'lib/foundation_api/json_rpc/exceptions.rb', line 38

def response
  RESPONSES[code]
end