GrpcStatusException

Available in a dev version: 0․11․0-grpc-186

How to configure

Exception used for propagating gRPC status information in non-OK results.

This is the primary mechanism for reporting and handling errors in gRPC calls. When a server encounters an error, it typically throws a GrpcStatusException with an appropriate GrpcStatusCode to signal the failure to the client. Clients receive this exception when remote calls fail with a non-OK status.

The easiest way to construct a GrpcStatusException is to use the GrpcStatusCode.asException extension function:

throw GrpcStatusCode.UNAUTHORIZED.asException("Authentication failed")

See also

actual typealias GrpcStatusException = StatusException(source)

Exception used for propagating gRPC status information in non-OK results.

This is the primary mechanism for reporting and handling errors in gRPC calls. When a server encounters an error, it typically throws a GrpcStatusException with an appropriate GrpcStatusCode to signal the failure to the client. Clients receive this exception when remote calls fail with a non-OK status.

The easiest way to construct a GrpcStatusException is to use the GrpcStatusCode.asException extension function:

throw GrpcStatusCode.UNAUTHORIZED.asException("Authentication failed")

See also

Exception used for propagating gRPC status information in non-OK results.

This is the primary mechanism for reporting and handling errors in gRPC calls. When a server encounters an error, it typically throws a GrpcStatusException with an appropriate GrpcStatusCode to signal the failure to the client. Clients receive this exception when remote calls fail with a non-OK status.

The easiest way to construct a GrpcStatusException is to use the GrpcStatusCode.asException extension function:

throw GrpcStatusCode.UNAUTHORIZED.asException("Authentication failed")

See also

Constructors

Link copied to clipboard
expect constructor(status: GrpcStatus)
expect constructor(status: GrpcStatus, trailers: GrpcMetadata?)
actual constructor(status: GrpcStatus)
actual constructor(status: GrpcStatus, trailers: GrpcMetadata?)

Properties

cause
Link copied to clipboard
expect open val cause: Throwable?
open val cause: Throwable?
message
Link copied to clipboard
expect open val message: String?
open val message: String?
Link copied to clipboard

The status associated with this exception.

Link copied to clipboard

The trailing metadata associated with this exception, or null if not present.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String