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
-
-
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 java.lang.ThrowablefillInStackTrace()StatusgetStatus()Returns the status code as aStatusobject.MetadatagetTrailers()Returns the received 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
-
-
Method Detail
-
fillInStackTrace
public java.lang.Throwable fillInStackTrace()
- Overrides:
fillInStackTracein classjava.lang.Throwable
-
getTrailers
public final Metadata getTrailers()
Returns the received trailers.- Since:
- 1.0.0
-
-