Fix apps.getLogs usage

This commit is contained in:
Girish Ramakrishnan
2017-04-19 21:43:29 -07:00
parent 5424a658f3
commit 8ded006dea

View File

@@ -329,7 +329,12 @@ function getLogStream(req, res, next) {
if (req.headers.accept !== 'text/event-stream') return next(new HttpError(400, 'This API call requires EventStream'));
apps.getLogs(req.params.id, lines, true /* follow */, function (error, logStream) {
var options = {
lines: lines,
follow: true
};
apps.getLogs(req.params.id, options, function (error, logStream) {
if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, 'No such app'));
if (error && error.reason === AppsError.BAD_STATE) return next(new HttpError(412, error.message));
if (error) return next(new HttpError(500, error));