Add isNonRetriable field to WorkflowTaskFailureDetails

Signed-off-by: Mason <theforbiddenai@gmail.com>
This commit is contained in:
Mason 2025-06-09 14:54:05 -04:00
parent 5e47afb03b
commit d1dc8f7e38
2 changed files with 15 additions and 2 deletions

View File

@ -17,6 +17,7 @@ public class WorkflowTaskFailureDetails {
private final String errorType;
private final String errorMessage;
private final String stackTrace;
private final boolean isNonRetriable;
/**
* Constructor for WorkflowTaskFailureDetails.
@ -24,14 +25,17 @@ public class WorkflowTaskFailureDetails {
* @param errorType The type of error
* @param errorMessage The error message
* @param stackTrace The stacktrace of the error
* @param isNonRetriable Whether the failure is retriable or not
*/
public WorkflowTaskFailureDetails(
String errorType,
String errorMessage,
String stackTrace) {
String stackTrace,
boolean isNonRetriable) {
this.errorType = errorType;
this.errorMessage = errorMessage;
this.stackTrace = stackTrace;
this.isNonRetriable = isNonRetriable;
}
/**
@ -64,6 +68,14 @@ public class WorkflowTaskFailureDetails {
return this.stackTrace;
}
/**
* Returns {@code true} if the failure doesn't permit retries, otherwise {@code false}.
* @return {@code true} if the failure doesn't permit retries, otherwise {@code false}.
*/
public boolean isNonRetriable() {
return this.isNonRetriable;
}
/**
* Returns {@code true} if the task failure was provided by the specified exception type, otherwise {@code false}.
*

View File

@ -273,7 +273,8 @@ public class DefaultWorkflowContext implements WorkflowContext {
WorkflowTaskFailureDetails workflowFailureDetails = new WorkflowTaskFailureDetails(
failureDetails.getErrorType(),
failureDetails.getErrorMessage(),
failureDetails.getStackTrace()
failureDetails.getStackTrace(),
failureDetails.isNonRetriable()
);
WorkflowTaskRetryContext workflowRetryContext = new WorkflowTaskRetryContext(
this,