Browse Source

Include stream path in "no such stream" errors

tags/nilmdb-1.4.7
Jim Paris 11 years ago
parent
commit
04def60021
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      nilmdb/server/server.py

+ 4
- 6
nilmdb/server/server.py View File

@@ -317,9 +317,8 @@ class Stream(NilmApp):
body = cherrypy.request.body.read()

# Check path and get layout
streams = self.db.stream_list(path = path)
if len(streams) != 1:
raise cherrypy.HTTPError("404 Not Found", "No such stream")
if len(self.db.stream_list(path = path)) != 1:
raise cherrypy.HTTPError("404", "No such stream: " + path)

# Check limits
(start, end) = self._get_times(start, end)
@@ -416,9 +415,8 @@ class Stream(NilmApp):
(start, end) = self._get_times(start, end)

# Check path and get layout
streams = self.db.stream_list(path = path)
if len(streams) != 1:
raise cherrypy.HTTPError("404 Not Found", "No such stream")
if len(self.db.stream_list(path = path)) != 1:
raise cherrypy.HTTPError("404", "No such stream: " + path)

@workaround_cp_bug_1200
def content(start, end):


Loading…
Cancel
Save