Exception: Bybit::ApiError
Overview
Raised when the server returns HTTP 200 + retCode != 0 (the V5 norm), or when a transport-level error is enriched with a Bybit body payload.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#ret_code ⇒ Object
readonly
Returns the value of attribute ret_code.
-
#ret_msg ⇒ Object
readonly
Returns the value of attribute ret_msg.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(response, http_status: nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(response, http_status: nil) ⇒ ApiError
Returns a new instance of ApiError.
28 29 30 31 32 33 34 35 |
# File 'lib/bybit/error.rb', line 28 def initialize(response, http_status: nil) @ret_code = response['retCode'] @ret_msg = response['retMsg'] @result = response['result'] @time = response['time'] @http_status = http_status super("[#{@ret_code}] #{@ret_msg}") end |
Instance Attribute Details
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
26 27 28 |
# File 'lib/bybit/error.rb', line 26 def http_status @http_status end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
26 27 28 |
# File 'lib/bybit/error.rb', line 26 def result @result end |
#ret_code ⇒ Object (readonly)
Returns the value of attribute ret_code.
26 27 28 |
# File 'lib/bybit/error.rb', line 26 def ret_code @ret_code end |
#ret_msg ⇒ Object (readonly)
Returns the value of attribute ret_msg.
26 27 28 |
# File 'lib/bybit/error.rb', line 26 def ret_msg @ret_msg end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
26 27 28 |
# File 'lib/bybit/error.rb', line 26 def time @time end |