summaryrefslogtreecommitdiff
path: root/paste/fileapp.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2007-01-18 17:26:33 +0000
committerianb <devnull@localhost>2007-01-18 17:26:33 +0000
commit1f5a6cc32b2ebfd186911059153a95803f3a9e09 (patch)
treeb334b59b44f265894a7faf743cbd5884c4621775 /paste/fileapp.py
parente76b1fd619965ac9b550c05914dd2c9f03c75af7 (diff)
downloadpaste-1f5a6cc32b2ebfd186911059153a95803f3a9e09.tar.gz
Handle file not found in FileApp
Diffstat (limited to 'paste/fileapp.py')
-rw-r--r--paste/fileapp.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/paste/fileapp.py b/paste/fileapp.py
index 45d2e05..9e46b8b 100644
--- a/paste/fileapp.py
+++ b/paste/fileapp.py
@@ -181,6 +181,11 @@ class FileApp(DataApp):
else:
self.update()
if not self.content:
+ if not os.path.exists(self.filename):
+ exc = HTTPNotFound(
+ 'The resource does not exist',
+ comment="No file at %r" % self.filename)
+ return exc(environ, start_response)
try:
file = open(self.filename, 'rb')
except (IOError, OSError), e: