コード例 #1
0
ファイル: channelz.py プロジェクト: Falco20019/grpc
 def GetChannel(request, context):
     try:
         return json_format.Parse(
             cygrpc.channelz_get_channel(request.channel_id),
             _channelz_pb2.GetChannelResponse(),
         )
     except ValueError as e:
         context.set_code(grpc.StatusCode.NOT_FOUND)
         context.set_details(str(e))
     except json_format.ParseError as e:
         context.set_code(grpc.StatusCode.INTERNAL)
         context.set_details(str(e))
コード例 #2
0
ファイル: channelz.py プロジェクト: mix-php/grpc-compiler
 def GetChannel(request, context):
     try:
         return json_format.Parse(
             cygrpc.channelz_get_channel(request.channel_id),
             _channelz_pb2.GetChannelResponse(),
         )
     except ValueError as e:
         context.set_code(grpc.StatusCode.NOT_FOUND)
         context.set_details(str(e))
     except json_format.ParseError as e:
         context.set_code(grpc.StatusCode.INTERNAL)
         context.set_details(str(e))