From c5ebdf4428d9d9aab04cf6085a231ed6ea5bf0ab Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 12 Mar 2019 22:57:43 +0100 Subject: Handle NoResultFound in raw handler --- pastepy.py | 3 +++ 1 file changed, 3 insertions(+) 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() -- cgit v1.2.3