class
GRPC::StatusError
- GRPC::StatusError
- Exception
- Reference
- Object
Overview
StatusError is raised when an RPC call fails with a non-OK gRPC status. This is the primary exception users should rescue in application code.
Example: begin reply = client.say_hello(req) rescue ex : GRPC::StatusError puts ex.code # => GRPC::StatusCode::NOT_FOUND puts ex.message # => "user not found" end
Defined in:
grpc/error.crConstructors
- .new(status : Status, trailers : Metadata = Metadata.new, cause : Exception | Nil = nil)
- .new(code : StatusCode, message : String = "", cause : Exception | Nil = nil)