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

Instance Method Details

#forbiddenObject



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.permissions}"
  render 'errors/forbidden', status: 403
end

#goneObject



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_foundObject



17
18
19
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 17

def not_found
  render 'errors/not_found', status: 404
end

#unauthorizedObject



26
27
28
# File 'lib/mumuki/laboratory/controllers/dynamic_errors.rb', line 26

def unauthorized
  render 'errors/unauthorized', status: 401
end