Exception: Dscf::Core::AuthenticationError

Inherits:
StandardError
  • Object
show all
Defined in:
app/errors/dscf/core/authentication_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = "Authentication failed", status_code = 401) ⇒ AuthenticationError

Returns a new instance of AuthenticationError.



6
7
8
9
# File 'app/errors/dscf/core/authentication_error.rb', line 6

def initialize(message = "Authentication failed", status_code = 401)
  super(message)
  @status_code = status_code
end

Instance Attribute Details

#status_codeObject (readonly)

Returns the value of attribute status_code.



4
5
6
# File 'app/errors/dscf/core/authentication_error.rb', line 4

def status_code
  @status_code
end

Instance Method Details

#to_hashObject



11
12
13
14
15
16
# File 'app/errors/dscf/core/authentication_error.rb', line 11

def to_hash
  {
    error: message,
    status: status_code
  }
end