summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2019-03-12 22:57:43 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2019-03-12 22:57:43 +0100
commitc5ebdf4428d9d9aab04cf6085a231ed6ea5bf0ab (patch)
treea90ad9d4e5ded6c0f7e945b0719f28d4a5b5d235
parent1473de0aaa1e066bce853fc78a2ba6473a0c176e (diff)
Handle NoResultFound in raw handler
-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()