Skip to content

Commit

Permalink
Improves error message for when user is logged out
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorjdawson committed May 25, 2021
1 parent 728088b commit d4bf676
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "croncat",
"version": "1.0.1",
"version": "1.0.2",
"description": "cron.cat CLI and Agent Runner",
"main": "src/index.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ export async function registerAgent() {
await manager.register_agent({}, BASE_GAS_FEE, BASE_ATTACHED_PAYMENT)
log(`Registered Agent: ${chalk.white(AGENT_ACCOUNT_ID)}`)
} catch (e) {
log(`${chalk.red('Registered Failed: ')}${chalk.bold.red('Please remove your credentials and trying again.')}`)
if(e.type === 'KeyNotFound') {
log(`${chalk.red('Agent Registration Failed:')} ${chalk.bold.red(`Please login to your account '${AGENT_ACCOUNT_ID}' and try again.`)}`)
} else {
log(`${chalk.red('Agent Registration Failed:')} ${chalk.bold.red('Please remove your credentials and trying again.')}`)
}
process.exit(1)
}
}
Expand Down

0 comments on commit d4bf676

Please sign in to comment.