Google App Engine (Python SDK) - How to catch db exceptions -
i'm using google app engine python , encountering errors this:
raise badvalueerror('property %s not multi-line' % self.name) badvalueerror: property title not multi-line error 2014-09-20 16:01:23,969 wsgi.py:278] traceback (most recent call last):
i've imported db module: from google.appengine.ext import db
and attempting silently (for now) catch error code this:
try: r.put() except db.error: pass
yet error continues break program execution. doing wrong? (or not doing?)
thanks...
here full traceback:
traceback (most recent call last): file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 1511, in __call__ rv = self.handle_exception(request, response, e) file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 1505, in __call__ rv = self.router.dispatch(request, response) file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher return route.handler_adapter(request, response) file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 1077, in __call__ return handler.dispatch() file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 547, in dispatch return self.handle_exception(e, self.app.debug) file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/lib/webapp2-2.3/webapp2.py", line 545, in dispatch return method(*args, **kwargs) file "/users/me/myapp/myapp.py", line 191, in date_last_modified = date_last_modified) file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/google/appengine/ext/db/__init__.py", line 970, in __init__ prop.__set__(self, value) file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/google/appengine/ext/db/__init__.py", line 614, in __set__ value = self.validate(value) file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/google/appengine/ext/db/__init__.py", line 2847, in validate raise badvalueerror('property %s not multi-line' % self.name) badvalueerror: property column_series not multi-line
the exception raised while setting attribute; can see last part of line should catch exception in code in traceback:
file "/users/me/myapp/myapp.py", line 191, in date_last_modified = date_last_modified)
you creating or updating instance there, , that's exception should caught, not when calling r.put()
.
Comments
Post a Comment