Improver error message

lp bug: https://launchpad.net/bugs/377614 fixed

bzr revid: hda@hda-20090722131610-knyx1hajh4orf9bu
This commit is contained in:
YSA 2009-07-22 18:46:10 +05:30 committed by husen daudi
parent eb84f043b1
commit f8867b5024
1 changed files with 14 additions and 3 deletions

View File

@ -109,7 +109,14 @@ class email_parser(object):
import netsvc
netsvc.Logger().notifyChannel('mailgate', netsvc.LOG_ERROR, "%s" % e)
id = self.rpc('crm.case', 'create', data)
try:
id = self.rpc('crm.case', 'create', data)
except Exception,e:
if getattr(e,'faultCode','') and 'AccessError' in e.faultCode:
e = '\n\nThe Specified user does not have an access to the CRM case.'
print e
attachments = message['attachment']
for attach in attachments or []:
@ -316,7 +323,11 @@ if __name__ == '__main__':
msg_txt = email.message_from_file(sys.stdin)
parser.parse(msg_txt)
try :
parser.parse(msg_txt)
except Exception,e:
if getattr(e,'faultCode','') and 'Connection unexpectedly closed' in e.faultCode:
print e
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: