Changeset 602
- Timestamp:
- Jun 13, 2008, 4:03:01 AM (17 years ago)
- Location:
- trunk/packages/sipb-xen-www/code
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/main.py
r601 r602 119 119 120 120 def error(op, username, fields, err, emsg, traceback): 121 """Print an error page when a CodeErroroccurs"""121 """Print an error page when an exception occurs""" 122 122 d = dict(op=op, user=username, fields=fields, 123 123 errorMessage=str(err), stderr=emsg, traceback=traceback) … … 585 585 def throwError(_, __, ___): 586 586 """Throw an error, to test the error-tracing mechanisms.""" 587 raise CodeError("test of the emergency broadcast system")587 raise RuntimeError("test of the emergency broadcast system") 588 588 589 589 mapping = dict(list=listVms, … … 677 677 checkpoint.checkpoint('output as a string') 678 678 except Exception, err: 679 import traceback680 679 if not fields.has_key('js'): 681 if isinstance(err, CodeError):682 self.start('500 Internal Server Error', [('Content-Type', 'text/html')])683 e = revertStandardError()684 s = error(operation, self.username, fields,685 err, e, traceback.format_exc())686 yield str(s)687 return688 680 if isinstance(err, InvalidInput): 689 681 self.start('200 OK', [('Content-Type', 'text/html')]) … … 691 683 yield str(invalidInput(operation, self.username, fields, err, e)) 692 684 return 693 self.start('500 Internal Server Error', [('Content-Type', 'text/plain')]) 694 send_error_mail('xvm error: %s' % (err,), 695 '%s\n' % (traceback.format_exc(),)) 696 yield '''Uh-oh! We experienced an error. 697 Sorry about that. We've gotten mail about it. 698 699 Feel free to poke us at xvm@mit.edu if this bug is 700 consistently biting you and we don't seem to be fixing it. 701 702 In case you're curious, the gory details are here. 703 ---- 704 %s 705 ---- 706 %s 707 ----''' % (str(err), traceback.format_exc()) 685 import traceback 686 self.start('500 Internal Server Error', 687 [('Content-Type', 'text/html')]) 688 e = revertStandardError() 689 s = error(operation, self.username, fields, 690 err, e, traceback.format_exc()) 691 yield str(s) 692 return 708 693 status = headers.setdefault('Status', '200 OK') 709 694 del headers['Status'] -
trunk/packages/sipb-xen-www/code/templates/error_raw.tmpl
r601 r602 10 10 ---- end error output 11 11 12 Traceback:13 12 $traceback
Note: See TracChangeset
for help on using the changeset viewer.