Package io.grpc
Class StatusException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- io.grpc.StatusException
-
- All Implemented Interfaces:
java.io.Serializable
public class StatusException extends java.lang.ExceptionStatusin 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
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUIDprivate Statusstatusprivate Metadatatrailers
-
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.StatusException(Status status, Metadata trailers, boolean fillInStackTrace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StatusgetStatus()Returns the status code as aStatusobject.MetadatagetTrailers()Returns the received trailers.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
status
private final Status status
-
trailers
private final Metadata trailers
-
-
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
-
-