Commits

Anonymous committed fd1d6ec

- Return 404, not 500, when file not found in tip+ revision

Comments (0)

Files changed (2)

 # Specify a location to redirect to when the top-level index is requested.
 # If not specified, gives 404 NOT FOUND when top-level index is requested.
 # This is useful for browsing documentation locally.
-slipper.DEFAULT.index_path = dev/tip+/doc/
+slipper.DEFAULT.index_path = /dev/tip+/doc/
 
 # For each repository, choose a name, then specify both the location
 # of the repository on the local filesystem ('local_dir') and the base
         repo = localrepository(None, config.local_dir)
         if revision == 'tip+':
             ctx = repo.workingctx()
+            revision = 'tip'
         else:
             ctx = repo.changectx(revision)
         try:
                 ]
             start_response(status, response_headers)
             return [status]
-        data = filectx.data()
+        try:
+            data = filectx.data()
+        except IOError:
+            # XXX: HTTP experts: is this correct?
+            status = '404 NOT FOUND'
+            response_headers = [
+                ('Content-Type', 'text/plain'),
+                ]
+            start_response(status, response_headers)
+            return [status]
         date = datestr(filectx.date())
         # XXX: HTTP experts: How do we short-circuit if the client's side is
         # up-to-date?