[Tutor] error, i m unable to find the error for past 1week, this doesnt work, please help me out

anil maran anilmrn at yahoo.com
Sun Aug 6 09:58:07 CEST 2006


You can override the web.internalerror function to have it to do other 
 interesting things. For example, I have infogami send me an email with 
 the full debugerror traceback whenever there's a crash: 
 olderror = web.internalerror 
 def error(): 
     olderror() 
     import sys, traceback 
     tb = sys.exc_info() 
     text = """From: the bugman <y... at example.com> 
 To: the bugfixer <y... at example.com> 
 Subject: bug: %s: %s (%s) 
 Content-Type: multipart/mixed; boundary="----here----" 
 
------here---- 
 Content-Type: text/plain 
 Content-Disposition: inline 
 
%s 
 
%s 
 
------here---- 
 Content-Type: text/html; name="bug.html" 
 Content-Disposition: attachment; filename="bug.html" 
 
""" % (tb[0], tb[1], web.ctx.path, web.ctx.method+' '+web.ctx.home+web.ctx.f 
 ullpath, 
      ''.join(traceback.format_exception(*tb)), 
     text += str(web.djangoerror()) 
     utils.send('... at example.com', '... at example.com', text) 
 
web.internalerror = error    

 		
---------------------------------
Yahoo! Music Unlimited - Access over 1 million songs.Try it free. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060806/c9079525/attachment.htm 


More information about the Tutor mailing list