-
Notifications
You must be signed in to change notification settings - Fork 8
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
Simplify default error message #1662
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1662 +/- ##
============================================
- Coverage 70.32% 70.32% -0.01%
Complexity 2017 2017
============================================
Files 254 254
Lines 7920 7919 -1
Branches 746 746
============================================
- Hits 5570 5569 -1
Misses 2070 2070
Partials 280 280 ☔ View full report in Codecov by Sentry. |
I certainly don't have all of the context here, so @shubham1g5 if you or you know of anyone else who has thoughts on this, feel free to ping them. It seems ideal to make a change like this. |
@@ -268,8 +268,7 @@ private SubmitResponseBean processFormXml(FormSubmissionContext context) throws | |||
} catch (HttpClientErrorException e) { | |||
return getErrorResponse( | |||
context.getHttpRequest(), Constants.SUBMIT_RESPONSE_ERROR, | |||
String.format("Form submission failed with error response: %s, %s, %s", | |||
e.getMessage(), e.getResponseBodyAsString(), e.getResponseHeaders()), | |||
String.format("Form submission failed with error response: %s", e.getResponseBodyAsString()), |
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.
agree that it will be helpful to have response code here when the reponse body is empty.
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.
Cool updated to use getMessage
which appears to include the status code in testing.
Product Description
This results in the following difference:
vs

Technical Summary
The first example doesn't seem ideal to display to users. I believe
getResponseBodyAsString
should be sufficient to display the error to the user with enough information to take action or get help.Safety Assurance
Safety story
This only impacts general errors on form submissions. I would assume that if a typical user comes across an error like this, they would be overwhelmed and potentially not even see the useful part of the message.
The risk is that we return errors with empty messages, in which case it will render like this:

Perhaps including the http status code at the very least would be helpful in the event the user receives an empty error message and reports it to us.
Automated test coverage
QA Plan
Special deploy instructions
Rollback instructions
Review