Changeset 603 for trunk/packages
- Timestamp:
- Jun 13, 2008, 4:10:10 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/main.py
r602 r603 117 117 118 118 DEFAULT_HEADERS = {'Content-Type': 'text/html'} 119 120 def error(op, username, fields, err, emsg, traceback):121 """Print an error page when an exception occurs"""122 d = dict(op=op, user=username, fields=fields,123 errorMessage=str(err), stderr=emsg, traceback=traceback)124 details = templates.error_raw(searchList=[d])125 send_error_mail('xvm error on %s for %s: %s' % (op, username, err),126 details)127 d['details'] = details128 return templates.error(searchList=[d])129 119 130 120 def invalidInput(op, username, fields, err, emsg): … … 618 608 p.wait() 619 609 610 def show_error(op, username, fields, err, emsg, traceback): 611 """Print an error page when an exception occurs""" 612 d = dict(op=op, user=username, fields=fields, 613 errorMessage=str(err), stderr=emsg, traceback=traceback) 614 details = templates.error_raw(searchList=[d]) 615 send_error_mail('xvm error on %s for %s: %s' % (op, username, err), 616 details) 617 d['details'] = details 618 return templates.error(searchList=[d]) 619 620 620 def getUser(environ): 621 621 """Return the current user based on the SSL environment variables""" … … 663 663 new_headers, output = output 664 664 headers.update(new_headers) 665 print 'MOO2'666 665 e = revertStandardError() 667 666 if e: … … 681 680 self.start('200 OK', [('Content-Type', 'text/html')]) 682 681 e = revertStandardError() 683 yield str(invalidInput(operation, self.username, fields, err, e)) 682 yield str(invalidInput(operation, self.username, fields, 683 err, e)) 684 684 return 685 685 import traceback … … 687 687 [('Content-Type', 'text/html')]) 688 688 e = revertStandardError() 689 s = error(operation, self.username, fields,689 s = show_error(operation, self.username, fields, 690 690 err, e, traceback.format_exc()) 691 691 yield str(s)
Note: See TracChangeset
for help on using the changeset viewer.