-
Notifications
You must be signed in to change notification settings - Fork 2
feat: adding configuration to provide exclusion for failOnError with http post processor #21
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
Conversation
| return !getExcludeFailOnErrorCodes(httpSourceConfig.getExcludeFailOnErrorsCodeRange()).contains(statusCode); | ||
| } | ||
|
|
||
| private HashSet<Integer> getExcludeFailOnErrorCodes(String input) { |
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.
We should save the list of error codes and not generate for every response. the list can be created and saved outside of the Response Handler.
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, made changes
| postResponseTelemetry.validateResponseCode(meterStatsManager, statusCode); | ||
| failureHandler("Received status code : " + statusCode); | ||
| boolean shouldFailOnError = (httpSourceConfig.isFailOnErrors() ? shouldFailOnError(statusCode) : false); | ||
| failureHandler("Received status code : " + statusCode, shouldFailOnError); |
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 would suggest to keep the method signature same.
and in line 131 do
if(shouldFailOnError(statusCode)) {
...
}
then the method sholdFailOnError will do the necessary checks.
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.
Made changes
lavkesh
left a comment
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 address the comments
feat: Added exclusion range with fail_on_errors for HTTP post-processors
GTF side we have some use cases where we must ignore some of the HTTP response codes when fail_on_errors is true.