Package io.grpc
Class StatusRuntimeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.grpc.StatusRuntimeException
-
- All Implemented Interfaces:
Serializable
public class StatusRuntimeException extends RuntimeException
Statusin RuntimeException form, for propagating Status information via exceptions.- See Also:
StatusException, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StatusRuntimeException(Status status)Constructs the exception with a status.StatusRuntimeException(Status status, Metadata trailers)Constructs the exception with both a status and trailers.
-
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.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
StatusRuntimeException
public StatusRuntimeException(Status status)
Constructs the exception with a status. See alsoStatus.asRuntimeException().- Since:
- 1.0.0
-
StatusRuntimeException
public StatusRuntimeException(Status status, @Nullable Metadata trailers)
Constructs the exception with both a status and trailers. See alsoStatus.asRuntimeException(Metadata).- Since:
- 1.0.0
-
-