【发布时间】:2016-08-27 15:03:58
【问题描述】:
很难跟踪 Google Endpoints 错误,该错误在响应时引发:
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 本机代码。
谢谢
【问题讨论】:
-
您知道触发错误的代码行吗?它不在回溯中。
-
@JohnGordon 这就是问题所在,Google Cloud Endpoints 内置代码引发的错误,无法在我的应用程序代码中捕获
标签: python google-app-engine google-cloud-endpoints