Package io.temporal.failure
Class ApplicationFailure.Builder
- java.lang.Object
-
- io.temporal.failure.ApplicationFailure.Builder
-
- Enclosing class:
- ApplicationFailure
public static final class ApplicationFailure.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApplicationFailurebuild()ApplicationFailure.BuildersetCategory(ApplicationErrorCategory category)Set the optional category of the failure.ApplicationFailure.BuildersetCause(java.lang.Throwable cause)Set the optional cause of the failure.ApplicationFailure.BuildersetDetails(Values details)Set the optional details of the failure.ApplicationFailure.BuildersetDetails(java.lang.Object... details)Set the optional details of the failure.ApplicationFailure.BuildersetMessage(java.lang.String message)Set the optional error message.ApplicationFailure.BuildersetNextRetryDelay(java.time.Duration nextRetryDelay)Set the optional delay before the next retry attempt.ApplicationFailure.BuildersetNonRetryable(boolean nonRetryable)Set the non retryable flag on the failure.ApplicationFailure.BuildersetType(java.lang.String type)Sets the error type of this failure.
-
-
-
Method Detail
-
setType
public ApplicationFailure.Builder setType(java.lang.String type)
Sets the error type of this failure. This is used byRetryOptions.Builder.setDoNotRetry(String...)to determine if the exception is non retryable.
-
setMessage
public ApplicationFailure.Builder setMessage(java.lang.String message)
Set the optional error message.Default is "".
-
setDetails
public ApplicationFailure.Builder setDetails(java.lang.Object... details)
Set the optional details of the failure.Details are serialized using the same approach as arguments and results.
-
setDetails
public ApplicationFailure.Builder setDetails(Values details)
Set the optional details of the failure.Details are serialized using the same approach as arguments and results.
-
setNonRetryable
public ApplicationFailure.Builder setNonRetryable(boolean nonRetryable)
Set the non retryable flag on the failure.It means that this exception is not going to be retried even if it is not included into retry policy doNotRetry list.
Default is false.
-
setCause
public ApplicationFailure.Builder setCause(java.lang.Throwable cause)
Set the optional cause of the failure. Each element of the cause chain will be converted toApplicationFailurefor network transmission across network if it doesn't extendTemporalFailure.
-
setNextRetryDelay
public ApplicationFailure.Builder setNextRetryDelay(java.time.Duration nextRetryDelay)
Set the optional delay before the next retry attempt. Overrides the normal retry delay.Default is null.
-
setCategory
public ApplicationFailure.Builder setCategory(ApplicationErrorCategory category)
Set the optional category of the failure.Default is
ApplicationErrorCategory.UNSPECIFIED.
-
build
public ApplicationFailure build()
-
-