From 84b2404cd223ed0e298364a1b1dd1484e8f49b9a Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Wed, 29 May 2013 12:20:12 +0530 Subject: [PATCH] [FIX]Fixed the issue of pad when there is no internet connection, it throws traceback instead of user freindly message. bzr revid: msh@openerp.com-20130529065012-8eaklgttdkhbg6mt --- addons/pad/pad.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/pad/pad.py b/addons/pad/pad.py index 90f5354054c..22e8931d12a 100644 --- a/addons/pad/pad.py +++ b/addons/pad/pad.py @@ -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"])