public class StatusException extends Exception
Status
in Exception form, for propagating Status information via exceptions. This is
semantically equivalent to StatusRuntimeException
, except for usage in APIs that promote
checked exceptions. gRPC's stubs favor StatusRuntimeException
.Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
Throwable |
fillInStackTrace() |
Status |
getStatus()
Returns the status code as a
Status object. |
Metadata |
getTrailers()
Returns the received trailers.
|
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public StatusException(Status status)
Status.asException()
.public StatusException(Status status, @Nullable Metadata trailers)
Status.asException(Metadata)
.public Throwable fillInStackTrace()
fillInStackTrace
in class Throwable
public final Metadata getTrailers()