Class StatusUtils
java.lang.Object
io.temporal.serviceclient.StatusUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends com.google.protobuf.Message>
TgetFailure(io.grpc.StatusRuntimeException exception, Class<T> failureType) static booleanhasFailure(io.grpc.StatusRuntimeException exception, Class<? extends com.google.protobuf.Message> failureType) Determines if a StatusRuntimeException contains a failure message of a given type.static <T extends com.google.protobuf.Message>
io.grpc.StatusRuntimeExceptionnewException(io.grpc.Status status, T details, com.google.protobuf.Descriptors.Descriptor detailsDescriptor) Create StatusRuntimeException with given details.
-
Constructor Details
-
StatusUtils
public StatusUtils()
-
-
Method Details
-
hasFailure
public static boolean hasFailure(io.grpc.StatusRuntimeException exception, Class<? extends com.google.protobuf.Message> failureType) Determines if a StatusRuntimeException contains a failure message of a given type.- Returns:
- true if the given failure is found, false otherwise
-
getFailure
public static <T extends com.google.protobuf.Message> T getFailure(io.grpc.StatusRuntimeException exception, Class<T> failureType) - Returns:
- a failure of a given type from the StatusRuntimeException object
-
newException
public static <T extends com.google.protobuf.Message> io.grpc.StatusRuntimeException newException(io.grpc.Status status, T details, com.google.protobuf.Descriptors.Descriptor detailsDescriptor) Create StatusRuntimeException with given details.
-