Exception: Subroutine::Auth::NotAuthorizedError
- Inherits:
-
StandardError
- Object
- StandardError
- Subroutine::Auth::NotAuthorizedError
- Defined in:
- lib/subroutine/auth/not_authorized_error.rb
Instance Method Summary collapse
-
#initialize(msg = nil) ⇒ NotAuthorizedError
constructor
A new instance of NotAuthorizedError.
- #status ⇒ Object
Constructor Details
#initialize(msg = nil) ⇒ NotAuthorizedError
Returns a new instance of NotAuthorizedError.
7 8 9 10 11 |
# File 'lib/subroutine/auth/not_authorized_error.rb', line 7 def initialize(msg = nil) msg = I18n.t("errors.#{msg}", default: "Sorry, you are not authorized to perform this action.") if msg.is_a?(Symbol) msg ||= I18n.t("errors.unauthorized", default: "Sorry, you are not authorized to perform this action.") super msg end |
Instance Method Details
#status ⇒ Object
13 14 15 |
# File 'lib/subroutine/auth/not_authorized_error.rb', line 13 def status 401 end |