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

[NIFI-13104] Unknown Route handling #8725

Merged
merged 4 commits into from
May 2, 2024

Conversation

rfellows
Copy link
Contributor

@rfellows rfellows commented May 1, 2024

NIFI-13104

  • 1st commit: All unknown routes now will show a Route Not Found error page
  • 2nd commit: Added a method to the error helper to safely get an error message from an HttpErrorResponse.

@rfellows rfellows added the new ui Pull requests for work relating to the new user interface being developed. label May 1, 2024
@mcgilman
Copy link
Contributor

mcgilman commented May 2, 2024

Reviewing...

@mcgilman mcgilman self-requested a review May 2, 2024 12:31
Copy link
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @rfellows! The fixes around the unmatched route looks good. I did not one minor suggestion below to help with readability.

I did however notice a number of additional instances that should be using the new getErrorString helper method. If you search for errorResponse.error and error.error with in this module I think you'll find a few more spots that need updating.

Comment on lines 84 to 88
if (errorResponse.error && errorResponse.status !== 0) {
errorMessage = errorResponse.error;
} else if (!errorResponse.error && errorResponse.status !== 0) {
errorMessage = errorResponse.message || `${errorResponse.status}`;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (errorResponse.error && errorResponse.status !== 0) {
errorMessage = errorResponse.error;
} else if (!errorResponse.error && errorResponse.status !== 0) {
errorMessage = errorResponse.message || `${errorResponse.status}`;
}
if (errorResponse.status !== 0) {
if (errorResponse.error) {
errorMessage = errorResponse.error;
} else {
errorMessage = errorResponse.message || `${errorResponse.status}`;
}
}

Copy link
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

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

Thanks for the update @rfellows! Will merge once CI completes.

@mcgilman mcgilman merged commit f87a0f4 into apache:main May 2, 2024
5 checks passed
shubhluck pushed a commit to shubhluck/nifi that referenced this pull request Jun 1, 2024
* [NIFI-13104] - Unknown route handling

* Add method to the ErrorHelper that safely gets an error string from an HttpErrorResponse object

* review feedback

* use errorHelper.fullScreenError in favor of directly calling the fullScreenError action

This closes apache#8725
shubhluck pushed a commit to shubhluck/nifi that referenced this pull request Jun 1, 2024
* [NIFI-13104] - Unknown route handling

* Add method to the ErrorHelper that safely gets an error string from an HttpErrorResponse object

* review feedback

* use errorHelper.fullScreenError in favor of directly calling the fullScreenError action

This closes apache#8725
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new ui Pull requests for work relating to the new user interface being developed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants