39
|
1 #!/usr/bin/python
|
|
2 # -*- coding: iso8859-1 -*-
|
|
3 #
|
|
4 # Copyright (C) 2003-2004 Edgewall Software
|
|
5 # Copyright (C) 2003-2004 Jonas Borgström <jonas@edgewall.com>
|
|
6 # All rights reserved.
|
|
7 #
|
|
8 # This software is licensed as described in the file COPYING, which
|
|
9 # you should have received as part of this distribution. The terms
|
|
10 # are also available at http://trac.edgewall.com/license.html.
|
|
11 #
|
|
12 # This software consists of voluntary contributions made by many
|
|
13 # individuals. For the exact contribution history, see the revision
|
|
14 # history and logs, available at http://projects.edgewall.com/trac/.
|
|
15 #
|
|
16 # Author: Jonas Borgström <jonas@edgewall.com>
|
|
17
|
|
18 try:
|
|
19 from trac.web import cgi_frontend
|
|
20 cgi_frontend.run()
|
|
21
|
|
22 except Exception, e:
|
|
23 import sys
|
|
24 import traceback
|
|
25
|
|
26 print>>sys.stderr, e
|
|
27 traceback.print_exc(file=sys.stderr)
|
|
28
|
|
29 print 'Status: 500 Internal Server Error'
|
|
30 print 'Content-Type: text/plain'
|
|
31 print
|
|
32 print 'Oops...'
|
|
33 print
|
|
34 print 'Trac detected an internal error:', e
|
|
35 print
|
|
36 traceback.print_exc(file=sys.stdout)
|