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
- #blocked_forum ⇒ Object
- #forbidden ⇒ Object
- #gone ⇒ Object
- #internal_server_error(exception) ⇒ Object
- #not_found ⇒ Object
- #unauthorized ⇒ Object
Instance Method Details
#blocked_forum ⇒ Object
36 37 38 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 36 def blocked_forum render 'errors/forbidden', status: 403, locals: { explanation: :blocked_forum_explanation } end |
#forbidden ⇒ Object
31 32 33 34 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 31 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, locals: { explanation: :forbidden_explanation } end |
#gone ⇒ Object
40 41 42 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 40 def gone render 'errors/gone', status: 410 end |
#internal_server_error(exception) ⇒ Object
22 23 24 25 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 22 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
18 19 20 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 18 def not_found render 'errors/not_found', status: 404, formats: [:html] end |
#unauthorized ⇒ Object
27 28 29 |
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 27 def render 'errors/unauthorized', status: 401 end |