From 2a57c4269aa2f42dbf897489f068cfac44df9ba1 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 23 Aug 2017 13:23:04 -0700 Subject: [PATCH] handle app not found --- src/routes/apps.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routes/apps.js b/src/routes/apps.js index 774589f24..73f5937b6 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -542,6 +542,7 @@ function uploadFile(req, res, next) { if (!req.files.file) return next(new HttpError(400, 'file must be provided as multipart')); apps.uploadFile(req.params.id, req.files.file.path, req.query.file, function (error) { + if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, error.message)); if (error) return next(new HttpError(500, error)); debug('uploadFile: done');