Class DexServiceException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.superdurable.dex.exceptions.DexServiceException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ChannelMessageNotFoundException, FlowAlreadyStartedException, FlowClosingException, FlowNotActiveOrNotFoundException, FlowNotFoundException, LongPollTimeoutException, RequestTimeoutException, RpcLockConflictException, WorkerInvocationException

public class DexServiceException extends RuntimeException
Reports a Dex API failure translated from a gRPC response.

Inspect the standard gRPC getCode() first and the optional Dex getSubStatus() when application recovery needs a more precise category. Prefer a concrete subclass such as FlowNotFoundException for expected outcomes and use this base type for diagnostics or uncategorized service failures.

try {
    client.describeFlow("order-123");
} catch (FlowNotFoundException missing) {
    createOrder();
} catch (DexServiceException serviceFailure) {
    log.error("Dex {}: {}", serviceFailure.getCode(), serviceFailure.getDetail());
}
See Also:
  • Constructor Details

    • DexServiceException

      public DexServiceException(io.grpc.Status.Code code, ErrorSubStatus subStatus, String detail, Throwable cause)
      Creates a service exception with transport and Dex-specific status metadata.
      Parameters:
      code - the nonnull gRPC status code
      subStatus - the Dex-specific category, or null when unavailable
      detail - the server-provided error detail, which may be null
      cause - the original transport failure, which may be null
  • Method Details

    • getCode

      public io.grpc.Status.Code getCode()
      Returns the standard gRPC status code.
      Returns:
      the nonnull gRPC code
    • getSubStatus

      public ErrorSubStatus getSubStatus()
      Returns the Dex-specific error category.
      Returns:
      the category, or null when none was supplied or recognized
    • getDetail

      public String getDetail()
      Returns the error detail, which is the server-provided detail, preceded by call context for some Client operations.

      Some Client operations start the detail with their call context, so the message names the target. For example, a Client.getAttributes failure starts with getAttributes Flow order-42 Attributes order-status: before the Server detail. The detail equals the exception message.

      Returns:
      the detail, which may be null