Exception: Peatio::Auth::Error

Inherits:
Error
  • Object
show all
Defined in:
lib/peatio/auth/error.rb

Overview

Error repesent all errors that can be returned from Auth module.

Instance Attribute Summary collapse

Attributes inherited from Error

#code

Instance Method Summary collapse

Constructor Details

#initialize(reason = nil) ⇒ Error

Returns a new instance of Error.



9
10
11
12
13
14
15
16
# File 'lib/peatio/auth/error.rb', line 9

def initialize(reason = nil)
  @reason = reason

  super(
    code: 2001,
    text: "Authorization failed".tap { |t| t << ": #{reason}" if reason },
  )
end

Instance Attribute Details

#reasonString, JWT::* (readonly)

Returns Reason store underlying reason for given error.

Returns:

  • (String, JWT::*)

    Reason store underlying reason for given error.

See Also:



7
8
9
# File 'lib/peatio/auth/error.rb', line 7

def reason
  @reason
end