Package io.servicetalk.grpc.api
Class GrpcStatusException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.servicetalk.grpc.api.GrpcStatusException
- All Implemented Interfaces:
Serializable
A
GrpcStatus in exception form.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGrpcStatusException(GrpcStatus status) Constructs an instance with the givenGrpcStatus.GrpcStatusException(GrpcStatus status, Throwable cause) Constructs an instance with the givenGrpcStatus. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.rpc.StatusReturns the status details if any was included ornull.static GrpcStatusExceptionTranslates aThrowableinto aGrpcStatusException.static GrpcStatusExceptionof(com.google.rpc.Status status) Returns a newGrpcStatusExceptionfor the givenStatus.status()Returns the wrappedGrpcStatus.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
GrpcStatusException
Constructs an instance with the givenGrpcStatus.- Parameters:
status- status to be wrapped.
-
GrpcStatusException
Constructs an instance with the givenGrpcStatus.- Parameters:
status- status to be wrapped.cause- the cause of this exception.
-
-
Method Details
-
status
Returns the wrappedGrpcStatus.- Returns:
- the wrapped
GrpcStatus.
-
applicationStatus
@Nullable public com.google.rpc.Status applicationStatus()Returns the status details if any was included ornull.- Returns:
- the wrapped
Status.
-
of
Returns a newGrpcStatusExceptionfor the givenStatus.- Parameters:
status- the status- Returns:
- the exception created.
-
fromThrowable
Translates aThrowableinto aGrpcStatusException.- Parameters:
t- the throwable.- Returns:
GrpcStatusExceptionwith mappedGrpcStatusorGrpcStatusCode.UNKNOWNstatus with the throwable as the cause.
-