diff --git a/src/commands/create/action.js b/src/commands/create/action.js index 3f93669..0747f51 100644 --- a/src/commands/create/action.js +++ b/src/commands/create/action.js @@ -34,6 +34,7 @@ module.exports = async function action (params, utils) { } catch (err) { if (err.message === 'app_not_found') return Error(`No app found with app ID '${appID}'`) + if (err.message === 'unknown_error') return Error(`No app found with app ID '${appID}' or the user does not have permission to access the app.`) return } let envs = app.environments diff --git a/src/commands/deploy/action.js b/src/commands/deploy/action.js index 909b853..64f2169 100644 --- a/src/commands/deploy/action.js +++ b/src/commands/deploy/action.js @@ -16,7 +16,14 @@ module.exports = async function action (params, utils) { // Go get the app (if we didn't just create one) if (!app) { - app = await client.find({ token, appID, _staging }) + try { + app = await client.find({ token, appID, _staging }) + } + catch (err) { + if (err.message === 'app_not_found') return Error(`No app found with app ID '${appID}'`) + if (err.message === 'unknown_error') return Error(`No app found with app ID '${appID}' or the user does not have permission to access the app.`) + return + } } let envs = app.environments