2016-08-27 7 views
0

それは時間応答で上昇Googleのエンドポイントのエラーを追跡することは非常に難しい:キャッチGoogleのエンドポイントレスポンスエラー

Encountered unexpected error from ProtoRPC method implementation: ValidationError (Message MatchCenterResponseMessage is missing required field sport) (/base/data/home/runtimes/python27/python27_lib/versions/third_party/protorpc-1.0/protorpc/wsgi/service.py:191) 
Traceback (most recent call last): 
    File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/protorpc-1.0/protorpc/wsgi/service.py", line 182, in protorpc_service_app 
    encoded_response = protocol.encode_message(response) 
    File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/protorpc-1.0/protorpc/remote.py", line 1109, in encode_message 
    return self.__protocol.encode_message(message) 
    File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/protorpc-1.0/protorpc/protojson.py", line 179, in encode_message 
    message.check_initialized() 
    File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/protorpc-1.0/protorpc/messages.py", line 769, in check_initialized 
    (type(self).__name__, name)) 
ValidationError: Message ResponseMessage is missing required field xyz 

は、アプリケーションからこの例外をキャッチする任意の方法はありますか? Google Endpointのネイティブコードからではなく

ありがとうございます。

+0

エラーを引き起こすコード行を知っていますか?トレースバックにはありません。 –

+0

@JohnGordonが問題です。Google Cloud Endpointsの組み込みコードから生成されたエラーは、アプリケーションコードにキャッチできません。 –

答えて

0

try except構造を使用してエラーをキャッチできます。また、トレースは、多くのお手伝いをすることがあります。

try: 
    //your code 
Except ValidationError: 
    raiseError 
+0

これはGoogle Endpointsです。 –

+0

私はそれを知っています。送信するパラメータを確認することができます。追加情報については、エンドポイントのドキュメントをチェックすることができます。多分その助け。 –

関連する問題