Throw proper error to be shown if app name is not found

This commit is contained in:
Kasra Bigdeli
2018-01-05 00:04:40 -08:00
parent 1a634bc968
commit ce7fc35ed5
+2 -1
View File
@@ -16,7 +16,8 @@ router.post('/:appName/', function (req, res, next) {
dataStore.getAppDefinitions()
.then(function (apps) {
if (!apps[appName]) {
throw new Error('App not found!');
throw ApiStatusCodes.createError(ApiStatusCodes.STATUS_ERROR_GENERIC,
"App not found: " + appName + "! Make sure your app is created before deploy!");
}
next();
})