Changeset 598
- Timestamp:
- Jun 13, 2008, 2:32:32 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/main.py
r588 r598 580 580 return templates.unauth(searchList=[{'simple' : True}]) 581 581 582 def throwError(_, __, ___): 583 """Throw an error, to test the error-tracing mechanisms.""" 584 raise RuntimeError("This is a test of the emergency broadcast system.") 585 582 586 mapping = dict(list=listVms, 583 587 vnc=vnc, … … 587 591 create=create, 588 592 help=helpHandler, 589 unauth=unauthFront) 593 unauth=unauthFront, 594 errortest=throwError) 590 595 591 596 def printHeaders(headers): … … 595 600 print 596 601 602 def send_error_mail(subject, body): 603 import subprocess 604 605 to = 'xvm@mit.edu' 606 mail = """To: %s 607 From: root@xvm.mit.edu 608 Subject: %s 609 610 %s 611 """ % (to, subject, body) 612 p = subprocess.Popen(['/usr/sbin/sendmail', to], stdin=subprocess.PIPE) 613 p.stdin.write(mail) 614 p.stdin.close() 615 p.wait() 597 616 598 617 def getUser(environ): … … 669 688 self.start('500 Internal Server Error', [('Content-Type', 'text/plain')]) 670 689 import traceback 671 yield '''Uh-oh! We experienced an error.' 672 Please email xvm-dev@mit.edu with the contents of this page.' 690 send_error_mail('xvm error: %s' % (err,), 691 '%s\n' % (traceback.format_exc(),)) 692 yield '''Uh-oh! We experienced an error. 693 Sorry about that. We've gotten mail about it. 694 695 Feel free to poke us at xvm@mit.edu if this bug is 696 consistently biting you and we don't seem to be fixing it. 697 698 In case you're curious, the gory details are here. 673 699 ---- 674 700 %s
Note: See TracChangeset
for help on using the changeset viewer.