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
ConstructorDescriptionGrpcStatusException
(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.Status
Returns the status details if any was included ornull
.static GrpcStatusException
Translates aThrowable
into aGrpcStatusException
.static GrpcStatusException
of
(com.google.rpc.Status status) Returns a newGrpcStatusException
for 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 newGrpcStatusException
for the givenStatus
.- Parameters:
status
- the status- Returns:
- the exception created.
-
fromThrowable
Translates aThrowable
into aGrpcStatusException
.- Parameters:
t
- the throwable.- Returns:
GrpcStatusException
with mappedGrpcStatus
orGrpcStatusCode.UNKNOWN
status with the throwable as the cause.
-