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

Add error details to internal server error page when local #1195

Merged

Conversation

Nitemaeric
Copy link
Contributor

@Nitemaeric Nitemaeric commented Nov 21, 2024

Context

It's slightly inconvenient to switch to the server logs to see what is causing an internal server error on our local machines - namely when translations are missing.

I want to be told what the error is so I can immediately address it.

Changes proposed in this pull request

  • Add error details to internal server error page when in development.

Guidance to review

  • Any concerns?

Screenshots

CleanShot 2024-11-21 at 00 50 48@2x

@Nitemaeric Nitemaeric self-assigned this Nov 21, 2024
@Nitemaeric Nitemaeric requested review from a team as code owners November 21, 2024 00:48
@Nitemaeric Nitemaeric force-pushed the dd/add-error-details-to-internal-server-error-when-local branch 2 times, most recently from ddc014b to ec4b755 Compare November 21, 2024 00:52
Copy link
Contributor

@ollietreend ollietreend left a comment

Choose a reason for hiding this comment

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

I'm not entirely convinced this change is necessary, but if you think it'd be helpful then feel free to add it.

@@ -18,4 +18,18 @@
</p>
</div>
</div>

<% if Rails.env.development? %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to note that you may have some trouble getting past RSpec + Undercover with your changes to the controller action.

You might have more success leaving the controller untouched and doing this in the view:

Suggested change
<% if Rails.env.development? %>
<% if Rails.env.development? && exception = request.env["action_dispatch.exception"]&.cause %>

@Nitemaeric Nitemaeric force-pushed the dd/add-error-details-to-internal-server-error-when-local branch from ec4b755 to 27e32c1 Compare November 25, 2024 11:04
@Nitemaeric Nitemaeric force-pushed the dd/add-error-details-to-internal-server-error-when-local branch from 27e32c1 to b3270b8 Compare November 25, 2024 11:07
@Nitemaeric Nitemaeric merged commit 9ec3923 into main Nov 25, 2024
8 checks passed
@Nitemaeric Nitemaeric deleted the dd/add-error-details-to-internal-server-error-when-local branch November 25, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants