From 3cde6000b7b5ceffc0dd9a8a0f053f7652bebeeb Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 5 Nov 2011 10:13:34 +0100 Subject: Catch exceptions on non-existent pastes and return an empty 404 page. --- db.py | 1 + 1 file changed, 1 insertion(+) (limited to 'db.py') 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) -- cgit v1.2.3