handle app not found

This commit is contained in:
Girish Ramakrishnan
2017-08-23 13:23:04 -07:00
parent ca8813dce3
commit 2a57c4269a

View File

@@ -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');