Unittesting with webtests and calling with curl, fine so far.
Now, if curl-ing a method that expects an EnumField of messages.Enum also works fine as long as I provide correct values for this parameter.
If I don't, curl shows no answer at all (gets 500) and the server (local development) throws an error (see below).
What would be a good way to catch an error like this and provide the caller with a decent error message (in addition to HTTP 500)?
ERROR 2012-12-10 10:54:44,646 wsgi.py:235]
Traceback (most recent call last):
File "/Applications/GoogleAppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 223, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "/Applications/GoogleAppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/protorpc/protorpc/wsgi/util.py", line 161, in first_found_app
response = app(environ, first_found_start_response)
File "/Applications/GoogleAppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/protorpc/protorpc/wsgi/service.py", line 153, in protorpc_service_app
remote_info.request_type, environ['wsgi.input'].read(content_length))
File "/Applications/GoogleAppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/protorpc/protorpc/remote.py", line 1123, in decode_message
return self.__protocol.decode_message(message_type, encoded_message)
File "/Applications/GoogleAppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/protorpc/protorpc/protojson.py", line 214, in decode_message
message = decode_dictionary(message_type, dictionary)
File "/Applications/GoogleAppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/protorpc/protorpc/protojson.py", line 188, in decode_dictionary
item = field.type(item)
File "/Applications/GoogleAppEngine/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/protorpc/protorpc/messages.py", line 437, in __new__
(index, cls.__name__))
TypeError: No such value for MURKS in Enum ObjectTypes