-
Notifications
You must be signed in to change notification settings - Fork 2k
FINERACT-2217: Replace 500 by meaningful error when request requires c… #4948
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
base: develop
Are you sure you want to change the base?
Conversation
@javamak Please squash your commits. |
@@ -59,7 +60,8 @@ public Response processRequest(String reportName, MultivaluedMap<String, String> | |||
final String parameterTypeValue = ApiParameterHelper.parameterType(queryParams) ? "parameter" : "report"; | |||
final Map<String, String> reportParams = getReportParams(queryParams); | |||
ResponseHolder response = findReportExportService(exportMode) // | |||
.orElseThrow(() -> new IllegalArgumentException("Unsupported export target: " + exportMode)) // | |||
.orElseThrow(() -> new PlatformInternalServerException("error.msg.report.export.mode.unavailable", |
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.
Please return with GeneralPlatformDomainRuleException
instead and dont forget to attach test cases which ensures, the correct behaviour.
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.
Exception changed to GeneralPlatformDomainRuleException and test cases added. I was not sure if this is the correct exception as it is converted to 403 which in my understanding used for Auth.
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.
Please review my comments!
Review comments fixed. Please check |
|
@@ -0,0 +1,61 @@ | |||
package org.apache.fineract.infrastructure.dataqueries.service; |
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.
Licence header is missing
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.
Done.
a9a51d7
to
b4cc96b
Compare
@adamsaghy , Could you please review this and let me know if anything requires fixing. |
queryParams.put("R_officeId", List.of("2")); | ||
queryParams.put("exportS3", List.of("true")); | ||
|
||
assertThrows(GeneralPlatformDomainRuleException.class, |
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.
Please check the content of GeneralPlatformDomainRuleException
and whether it was thrown with this code:
error.msg.report.export.mode.unavailable
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.
Assertions added to validate the exception content.
Description
Fix to return a proper error message when S3 is not configured and a report request requires upload to S3.
(https://issues.apache.org/jira/browse/FINERACT-2217).
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.