Class: ErrorsController
Instance Attribute Summary
#current_user
Instance Method Summary
collapse
#policy, #verify_policy, #verify_policy_with_proc
inc_number_of_requests, original_title
#render_error
#authenticate!, #deauthenticate!, #logged_in?
Instance Method Details
#forbidden ⇒ Object
15
16
17
|
# File 'app/controllers/errors_controller.rb', line 15
def forbidden
render_error 403
end
|
#internal_error ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'app/controllers/errors_controller.rb', line 31
def internal_error
exception = request.env["action_dispatch.exception"]
if !exception
render_error 500
elsif exception.is_a?(PagesCore::NotAuthorized)
render_error 403
else
@report = encrypt_report(error_report(request, exception))
wrapper = ActionDispatch::ExceptionWrapper.new(nil, exception)
render_error wrapper.status_code
end
end
|
#not_found ⇒ Object
19
20
21
|
# File 'app/controllers/errors_controller.rb', line 19
def not_found
render_error 404
end
|
#report ⇒ Object
4
5
6
7
8
9
|
# File 'app/controllers/errors_controller.rb', line 4
def report
report = decrypt_report(params[:error_report])
report[:user] = User.find_by(id: report[:user_id]) if report.key?(:user_id)
deliver_error_report(report, params[:email], params[:description])
end
|
#show ⇒ Object
11
12
13
|
# File 'app/controllers/errors_controller.rb', line 11
def show
render_error params[:id].to_i
end
|
#unacceptable ⇒ Object
23
24
25
|
# File 'app/controllers/errors_controller.rb', line 23
def unacceptable
render_error 422
end
|
#unauthorized ⇒ Object
27
28
29
|
# File 'app/controllers/errors_controller.rb', line 27
def unauthorized
render_error 401
end
|