Check out the test cases, that's how they all pass.
try:
id = obj.save()
page_content = id
except DocumentException as e:
print e
On 02/26/2012 05:30 PM, Voltron wrote:
> It would be nice. As it is, I noticed that one cannot wrap the calls
> in a try/except clause:
>
> try:
> id = user.save()
> except Exception, detail:
> page_content = str(detail)
> else:
> page_content = id
>
> The tracebacks are only emitted by the logger,
>
looks like your not, try orm.DocumentException
or humongolus.DocumentException
depending on your imports
try:
_id = obj.save()
print _id
except orm.DocumentException as e:
print e.errors
On 02/27/2012 11:40 AM, Voltron wrote:
> I am not exactly sure what is going on, but I am even having problems
> with the DocumentException class
>
> Traceback (most recent call last):
> File "/applications/test/env/lib/python2.6/site-packages/tornado/
> web.py", line 988, in _execute
> getattr(self, self.request.method.lower())(*args, **kwargs)
> File "/applications/test/handlers/accounts.py", line 71, in get
> except DocumentException as e:
> NameError: global name 'DocumentException' is not defined
>
> Is the casse different for a document and not a from?
>
> Thanks
>
Also, are you getting any errors? Post those as well.
On 02/27/2012 11:55 AM, Voltron wrote:
> I noticed that a few seconds after posting :) but I still cannot wrap
> the save() though:
>
> #
> ------------------------------------------------------------------------------
> import uuid
> import tornado.web
> import datetime
> from models.users import User
>
> from humongolus import DocumentException
>
>