Exception: Subroutine::Auth::NotAuthorizedError
- Inherits:
-
StandardError
- Object
- StandardError
- Subroutine::Auth::NotAuthorizedError
- Defined in:
- lib/subroutine/auth.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.
6 7 8 9 10 |
# File 'lib/subroutine/auth.rb', line 6 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
12 13 14 |
# File 'lib/subroutine/auth.rb', line 12 def status 401 end |