summaryrefslogtreecommitdiff
path: root/db.py
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-11-05 10:13:34 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2011-11-05 10:14:08 +0100
commit3cde6000b7b5ceffc0dd9a8a0f053f7652bebeeb (patch)
treedcd1afae0c4e38b9667579a62fda9d9599ca4aed /db.py
parenta50c52ed2c6b82639b4dbbb50c2d2633bb3699e9 (diff)
Catch exceptions on non-existent pastes and return an empty 404 page.
Diffstat (limited to 'db.py')
-rw-r--r--db.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/db.py b/db.py
index 5ccc336..7a74ecb 100644
--- a/db.py
+++ b/db.py
@@ -1,6 +1,7 @@
from sqlalchemy import create_engine, Column, Integer, String, DateTime, Text, Index, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relation, backref
+from sqlalchemy.orm.exc import NoResultFound
import settings
engine = create_engine(settings.db_path)