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
INSPIRE Validator - exception handling improvements and Sonalint fixes #7519
INSPIRE Validator - exception handling improvements and Sonalint fixes #7519
Conversation
c5e695d
to
32164ad
Compare
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.
LGTM.
Log.error(Log.SERVICE, | ||
"INSPIRE service HTTP response: " + response.getStatusCode().value() + " for " + TESTOBJECTS_URL); |
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.
Isn't possible to log also the response body, maybe with a lower level log?
} catch (Exception e) { | ||
Log.error(Log.SERVICE, "Error calling INSPIRE service: " + endPoint, e); | ||
return null; | ||
throw new InspireValidatorException(String.format("Error calling INSPIRE service: %s, %s", endPoint, e.getMessage())); |
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.
I'd pass the full exception e
to new InspireValidatorException()
constructor to allow the logger to print Caused by: ...
and get the full stacktrace.
Refactor of the INSPIRE Validator backend code to improve the exception handling. Previously some exceptions were not reported properly to the user. For example, if the upload of a file to validate returned an error, due to the validator not working properly (for example, returning an error 503), the user got an unclear error message. Additionally this commit contains some fixes to Sonarlint warnings
This pull requests contains a refactor of the INSPIRE Validator backend code to improve the exception handling.
Previously some exceptions were not reported properly to the user. For example, if the upload of a file to validate returned an error, due to the validator not working properly (for example, returning an error 503), the user got an unclear error message:
Additionally, the pull request contains Sonarlint fixes.
Checklist
main
branch, backports managed with labelREADME.md
filespom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentation