diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2019-03-12 22:57:43 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2019-03-12 22:57:43 +0100 |
commit | c5ebdf4428d9d9aab04cf6085a231ed6ea5bf0ab (patch) | |
tree | a90ad9d4e5ded6c0f7e945b0719f28d4a5b5d235 | |
parent | 1473de0aaa1e066bce853fc78a2ba6473a0c176e (diff) |
Handle NoResultFound in raw handler
-rw-r--r-- | pastepy.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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() |