Module: Mumuki::Laboratory::Controllers::DynamicErrors
- Extended by:
- ActiveSupport::Concern
- Included in:
- ApplicationController
- Defined in:
- lib/mumuki/laboratory/controllers/dynamic_errors.rb
Instance Method Summary collapse
- #forbidden ⇒ Object
- #gone ⇒ Object
- #internal_server_error(exception) ⇒ Object
- #not_found ⇒ Object
- #unauthorized ⇒ Object
Instance Method Details
#forbidden ⇒ Object
30 31 32 33 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 30 def forbidden Rails.logger.info "Access to organization #{Organization.current} was forbidden to user #{current_user} with permissions #{current_user.}" render 'errors/forbidden', status: 403 end |
#gone ⇒ Object
35 36 37 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 35 def gone render 'errors/gone', status: 410 end |
#internal_server_error(exception) ⇒ Object
21 22 23 24 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 21 def internal_server_error(exception) Rails.logger.error "Internal server error: #{exception} \n#{exception.backtrace.join("\n")}" render 'errors/internal_server_error', status: 500 end |
#not_found ⇒ Object
17 18 19 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 17 def not_found render 'errors/not_found', status: 404 end |
#unauthorized ⇒ Object
26 27 28 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 26 def render 'errors/unauthorized', status: 401 end |