Skip to content
Permalink
Browse files

[ux] Notify user if the application doesn't exist

Fixes #421.
  • Loading branch information...
mmalecki committed Mar 24, 2013
1 parent 5576b0a commit 9aed8ca1446ee8c1b6c055aafee91f70faf5111f
Showing with 13 additions and 5 deletions.
  1. +13 −5 lib/jitsu/commands/logs.js
@@ -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();
});
});
}

0 comments on commit 9aed8ca

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.