Exception: Shaf::Errors::UnauthorizedError

Inherits:
ServerError show all
Defined in:
lib/shaf/errors.rb

Instance Attribute Summary

Attributes inherited from ServerError

#code, #title

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil) ⇒ UnauthorizedError

Returns a new instance of UnauthorizedError.



35
36
37
38
# File 'lib/shaf/errors.rb', line 35

def initialize(msg = nil)
  msg ||= "User is not authorized"
  super(msg, code: "UNAUTHORIZED", title: "Unauthorized user")
end

Instance Method Details

#http_statusObject



31
32
33
# File 'lib/shaf/errors.rb', line 31

def http_status
  401
end