summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pastepy.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/pastepy.py b/pastepy.py
index 734ba54..96d3f40 100644
--- a/pastepy.py
+++ b/pastepy.py
@@ -219,6 +219,9 @@ class Paste(object):
try:
session = db.Session()
paste = session.query(db.Paste).filter_by(hash = hash).one()
+ except db.NoResultFound:
+ self.start_response('404 Not Found', [])
+ return []
finally:
session.close()