Skip to main content
function GrpcRpc.abort
def GrpcRpc.abort(
code: typing.Any = ,
message: str = ,
/,
*,
status: typing.Any = 
) -> None
Abort the current RPC with the given status. Two forms:
  • rpc.abort(code, message) — positional short form, code is a grpc.Code.<NAME> int.
  • rpc.abort(status = grpc.Status(...)) — keyword full form for when you need details.
Side-effect only. Handler must return afterward. function GrpcRpc.cancelled
def GrpcRpc.cancelled() -> bool
Returns True if the client has cancelled the call. function GrpcRpc.metadata
def GrpcRpc.metadata() -> typing.Any
Request metadata (headers) as a dict[str, str]. ASCII entries only; binary (-bin) entries are not exposed. Includes transport headers like grpc-timeout when the client set a deadline.