[MERGE] [IMP] pad: catch urllib error, instead of showing traceback display helpful error message (opw 593069)

bzr revid: mat@openerp.com-20131118125113-tuekl7jeazbv86ti
This commit is contained in:
Martin Trigaux 2013-11-18 13:51:13 +01:00
commit 3b65fb1125
1 changed files with 5 additions and 1 deletions

View File

@ -39,7 +39,11 @@ class pad_common(osv.osv_memory):
#if create with content
if "field_name" in context and "model" in context and "object_id" in context:
myPad = EtherpadLiteClient( pad["key"], pad["server"]+'/api')
myPad.createPad(path)
try:
myPad.createPad(path)
except urllib2.URLError:
raise osv.except_osv(_("Error"), _("Pad creation fail, \
either there is a problem with your pad server URL or with your connection."))
#get attr on the field model
model = self.pool.get(context["model"])