Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOTT-4629: Improve exception handling #1769

Merged
merged 9 commits into from
Dec 22, 2023
Merged

Conversation

rasikasri
Copy link
Contributor

@rasikasri rasikasri commented Dec 15, 2023

Jira link

HOTT-4629

What?

I have added/removed/altered:

  • Added actions in the controller for the missing error-handling actions
  • added generic view for errors: error.html.erb view

Why?

I am doing this because:

  • There are certain exceptions in which are mapped in the default Rails behaviour to actions we don’t currently support

@willfish willfish force-pushed the HOTT-4629-error-controller branch from d858855 to a8f9b13 Compare December 20, 2023 11:18
@alexdesi alexdesi force-pushed the HOTT-4629-error-controller branch 6 times, most recently from 55d56ad to df28667 Compare December 20, 2023 18:04
@alexdesi alexdesi changed the title HOTT-4629: Extend Frontend ErrorsController HOTT-4629: Improve exception handling Dec 20, 2023
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.consider_all_requests_local = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The application will render the public error pages instead of detailed debug information.

Removed redundant views for error messages (reusing error.html.erb)
Support more errors in the routes.
@alexdesi alexdesi force-pushed the HOTT-4629-error-controller branch from df28667 to 77b4cd9 Compare December 20, 2023 18:13
@@ -0,0 +1,51 @@
RSpec.describe ApplicationController, type: :request do
Copy link
Contributor

@alexdesi alexdesi Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reconsidered the usefulness of these specs.
We can remove these. We are just (re)testing the mappings in the rails actionpack/lib/action_dispatch/middleware/exception_wrapper.rb are correct.

The useful tests are the spec/requests/errors_controller_spec.rb,
since the tests the routes and the rendered views.

Set consider_all_requests_local to true on Dev (to see detailed error reports).
@alexdesi alexdesi force-pushed the HOTT-4629-error-controller branch from 49c24cf to 5445c5f Compare December 21, 2023 16:37
@willfish willfish merged commit fb8dad8 into main Dec 22, 2023
3 checks passed
@willfish willfish deleted the HOTT-4629-error-controller branch December 22, 2023 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants