-
Notifications
You must be signed in to change notification settings - Fork 101
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
[PLUGIN-1837] Error management for Analytics plugin i.e. GroupByAggregate, Deduplicate, Distinct and Joiner #1903
Conversation
c0f275e
to
3b3b46f
Compare
2cb74cb
to
60c6dee
Compare
String error = String.format("Invalid filter operation. It should be of format " + | ||
"'fieldName:functionName'. But got : %s", filterOperation); | ||
throw ErrorUtils.getProgramFailureException(new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN), | ||
error, error, ErrorType.USER, false, new IllegalArgumentException(error)); |
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.
no need of wrapping it in IllegalArgumentException
, cause
can just be null
.
This comment applies to whole PR.
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.
How do you decide when to wrap vs keeping cause null
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.
If there is no exception being propagated, we don't need to introduce a separation exception here, cause can just be null
. In other cases, we are catching the exception and then wrapping it in ProgramFailureException
, hence it should be added as a cause
.
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.
Updated !
ffefd24
to
8c11489
Compare
throw new IllegalStateException("Unsupported condition type " + conditionType); | ||
String error = String.format("Unsupported condition type %s.", conditionType); | ||
throw ErrorUtils.getProgramFailureException(new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN), | ||
error, error, ErrorType.SYSTEM, false, null); |
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.
Unsupported condition
can be USER
error.
String errorMessage = String.format( | ||
"Invalid aggregate %s(%s): Field '%s' does not exist in input schema %s.", | ||
functionInfo.getFunction(), functionInfo.getField(), functionInfo.getField(), inputSchema)); | ||
functionInfo.getFunction(), functionInfo.getField(), functionInfo.getField(), inputSchema); | ||
String errorReason = String.format("Field '%s' does not exist in input schema %s.", | ||
functionInfo.getField(), inputSchema); | ||
throw ErrorUtils.getProgramFailureException(new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN), | ||
errorReason, errorMessage, ErrorType.USER, false, null); |
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.
both errorMessage
& errorReason
are same:
String errorMessage = String.format("Field '%s' does not exist in input schema %s.", functionInfo.getField(), inputSchema);
throw ErrorUtils.getProgramFailureException(new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN), errorMessage, errorMessage, ErrorType.USER, false, null);
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.
updated for whole PR
String errorReason = String.format("Field %s does not exist in input schema %s.", | ||
fieldName, inputSchema); | ||
String errorMessage = String.format("Failed to fetch record schema due to field %s does not exist in" + | ||
" input schema %s.", fieldName, inputSchema); | ||
throw ErrorUtils.getProgramFailureException(new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN), | ||
errorReason, errorMessage, ErrorType.USER, false, null); |
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.
similar comment here.
String errorMessage = String.format("Failed to fetch record schema due to field %s does not exist in" +
" input schema %s.", fieldName, inputSchema);
throw ErrorUtils.getProgramFailureException(new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN),
errorMessage, errorMessage, ErrorType.USER, false, null);
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.
updated
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.
If errorReason
& errorMessage
both are small, we can keep both same.
This comment applies to whole PR.
String errorMessage = String.format( | ||
"Failed to fetch function due to invalid function '%s', must be one of %s with message: %s.", |
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.
String errorMessage = String.format("Failed to fetch function due to invalid function '%s' with message: %s, must be one of %s.",
This comment applies to whole PR.
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.
updated at both places
Please squash commits before merge |
…ate, Distinct, and Joiner plugins
01473f2
to
11f1ecf
Compare
Jira : PLUGIN-1837
Test [ Distinct Aggregator ]
Raw Logs
POST v3/namespaces/{namespace-id}/apps/{app-id}/workflows/DataPipelineWorkflow/runs/{run-id}/classify