Package io.grpc
Class StatusException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- io.grpc.StatusException
-
- All Implemented Interfaces:
Serializable
public class StatusException extends Exception
Status
in Exception form, for propagating Status information via exceptions. This is semantically equivalent toStatusRuntimeException
, except for usage in APIs that promote checked exceptions. gRPC's stubs favorStatusRuntimeException
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StatusException(Status status)
Constructs an exception with both a status.StatusException(Status status, Metadata trailers)
Constructs an exception with both a status and trailers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Status
getStatus()
Returns the status code as aStatus
object.Metadata
getTrailers()
Returns the received trailers.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
StatusException
public StatusException(Status status)
Constructs an exception with both a status. See alsoStatus.asException()
.- Since:
- 1.0.0
-
StatusException
public StatusException(Status status, @Nullable Metadata trailers)
Constructs an exception with both a status and trailers. See alsoStatus.asException(Metadata)
.- Since:
- 1.0.0
-
-