diff options
author | root <root@dev.spline.de> | 2008-10-27 18:53:36 +0100 |
---|---|---|
committer | root <root@dev.spline.de> | 2008-10-27 18:53:36 +0100 |
commit | 5179bbf9ebcbd091cd3082858a72b76fad93e086 (patch) | |
tree | 798fe421ac2221982699c42b2109c46d5073f009 | |
parent | 236ad4c8dbef414ef29348634fd0a6ccded1a1d6 (diff) | |
download | dev-account-5179bbf9ebcbd091cd3082858a72b76fad93e086.tar.gz dev-account-5179bbf9ebcbd091cd3082858a72b76fad93e086.tar.xz dev-account-5179bbf9ebcbd091cd3082858a72b76fad93e086.zip |
check for db errors
-rw-r--r-- | index.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -46,7 +46,11 @@ def closedb(req): # start a new session and context and register the session dictionary in our # global template context def session_start(req, anonymous): - req.dbc = MySQLdb.connect(host="localhost", user="apache", passwd="password", db="trac") + try: + req.dbc = MySQLdb.connect(host="localhost", user="apache", passwd="password", db="trac") + except: + redirect(req, "db_error") + req.cursor = req.dbc.cursor() req.register_cleanup(closedb, req) |