Skip to content

Commit

Permalink
[ux] Notify user if the application doesn't exist
Browse files Browse the repository at this point in the history
Fixes #421.
  • Loading branch information
mmalecki committed Mar 24, 2013
1 parent 5576b0a commit 9aed8ca
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/jitsu/commands/logs.js
Expand Up @@ -103,14 +103,22 @@ logs.app = function (appName, amount, callback) {
}

function byApp(appName, amount, callback) {
jitsu.logs.byApp(appName, amount, function (err, results) {
jitsu.apps.view(appName, function (err) {
if (err) {
return callback(err);
return err.statusCode === 404
? callback(new Error('Application not found.'), true)
: callback(err);
}

jitsu.log.info('Listing logs for ' + appName.magenta);
putLogs(results, appName, amount);
callback();
jitsu.logs.byApp(appName, amount, function (err, results) {
if (err) {
return callback(err);
}

jitsu.log.info('Listing logs for ' + appName.magenta);
putLogs(results, appName, amount);
callback();
});
});
}

Expand Down

0 comments on commit 9aed8ca

Please sign in to comment.