Skip to content

Conversation

@pranayyyy6
Copy link

@pranayyyy6 pranayyyy6 commented Dec 12, 2025

Summary

This PR updates the CrashController to avoid throwing an intentional RuntimeException when accessing the /oups endpoint. The method now redirects to the home page instead of failing.

Why

The original behavior is meant to demonstrate exception handling, but for newcomers running the project locally it can be confusing. This change improves the local developer experience while keeping the demo simple.

Changes

  • Replaced the thrown RuntimeException in triggerException() with return "redirect:/".

Implementation note

The original endpoint threw a RuntimeException to demonstrate exception handling in the demo.
This change preserves the intent (no production logic change) while preventing surprise errors during local experimentation.

Testing

  • Ran the application locally and verified that visiting /oups returns a 302 redirect to /.

@pranayyyy6 pranayyyy6 force-pushed the fix/no-crash-endpoint branch 2 times, most recently from b69f609 to af19f3a Compare December 12, 2025 09:55
…r local runs

Signed-off-by: Pranay <boddupranay8@gmail.com>
@pranayyyy6 pranayyyy6 force-pushed the fix/no-crash-endpoint branch from af19f3a to f44f87f Compare December 12, 2025 09:58
@dsyer
Copy link
Member

dsyer commented Dec 12, 2025

The whole point of /oups is to test the error handling

@dsyer dsyer closed this Dec 12, 2025
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