-
Notifications
You must be signed in to change notification settings - Fork 19
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
Redirect to 404 page if css_id in URL is invalid #14172
Conversation
Code Climate has analyzed commit f58f290 and detected 0 issues on this pull request. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 🚀
@@ -126,7 +126,7 @@ def update | |||
private | |||
|
|||
def validate_user_id | |||
fail(Caseflow::Error::InvalidUserId, user_id: params[:user_id]) unless user | |||
fail(ActiveRecord::RecordNotFound, user_id: params[:user_id]) unless user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handled by
rescue_from ActiveRecord::RecordNotFound, with: :not_found |
and
caseflow/app/controllers/application_base_controller.rb
Lines 45 to 49 in 9d9bc30
def not_found | |
respond_to do |format| | |
format.html do | |
render "errors/404", layout: "application", status: :not_found | |
end |
which loads https://github.com/department-of-veterans-affairs/caseflow/blob/7168968e0529c4957f04128cef19be0d32d66161/app/views/errors/404.html.erb
and causes the frontend to display
caseflow/client/app/errors/Error404.jsx
Lines 29 to 34 in 984e53f
<StatusMessage title="Page not found"> | |
Oops! We can't find the correct page. If you need assistance, | |
please visit the <Link to="/help">Caseflow Help Page</Link>. | |
<p>If you continue to see this page, please contact | |
the <a href={this.props.feedbackUrl}>Caseflow Help Desk</a>.</p> | |
</StatusMessage> |
More here.
Resolves #13911
Description
Change to use user-friendly error page.
Acceptance Criteria
Testing Plan
User Facing Changes