Catch Google Endpoint Response Error
<p>It's very hard to track Google Endpoints error, which raised at the time response:</p>

<pre><code>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
</code></pre>

<p>Is there any ways to catch this exception from application? Instead of from Google Endpoint native code.</p>

<p>Thanks</p>

<p>You can use try except structure to catch the error. Also tracing may help you alot. </p>

<pre><code>try:
    //your code
Except ValidationError:
    raiseError
</code></pre>

python google-app-engine google-cloud-endpoints