| 1 |
#!/usr/bin/python |
|---|
| 2 |
# -*- coding: utf-8 -*- |
|---|
| 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 |
except Exception, e: |
|---|
| 22 |
print 'Content-Type: text/plain;charset=utf-8\r\n\r\n', |
|---|
| 23 |
print 'Aïe...' |
|---|
| 24 |
print |
|---|
| 25 |
print 'Trac a détecté une erreur interne:' |
|---|
| 26 |
print |
|---|
| 27 |
print e |
|---|
| 28 |
print |
|---|
| 29 |
import traceback |
|---|
| 30 |
import StringIO |
|---|
| 31 |
tb = StringIO.StringIO() |
|---|
| 32 |
traceback.print_exc(file=tb) |
|---|
| 33 |
print tb.getvalue() |
|---|