Skip to content

Commit

Permalink
feat: output more log when errors happened (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 authored Sep 18, 2024
1 parent 50992c0 commit 569a17f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 5 additions & 4 deletions apps/cli/src/command/dump.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,16 @@ export const DumpCommand = new BackendCommand<DumpOptions>(
.addExamples([
{
title: 'Save backend configuration to the default adc.yaml file',
command: 'adc dump'
command: 'adc dump',
},
{
title: 'Save backend configuration to the specified file',
command: 'adc dump -o service-configuration.yaml'
command: 'adc dump -o service-configuration.yaml',
},
{
title: 'Save only specified resource types from the backend',
command: 'adc dump --include-resource-type global_rule --include-resource-type plugin_metadata',
command:
'adc dump --include-resource-type global_rule --include-resource-type plugin_metadata',
},
{
title: 'Save only the resources with the specified labels',
Expand Down Expand Up @@ -126,7 +127,7 @@ export const DumpCommand = new BackendCommand<DumpOptions>(
try {
await tasks.run();
} catch (err) {
//console.log(chalk.red(`Failed to dump backend configuration from backend, ${err}`));
if (opts.verbose === 2) console.log(err);
process.exit(1);
}
});
1 change: 1 addition & 0 deletions apps/cli/src/command/ping.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const PingCommand = new BackendCommand<PingOptions>(
console.log(
chalk.red(`Unable to connect to the "${opts.backend}" backend. ${err}`),
);
if (opts.verbose === 2) console.log(err);
process.exit(1);
}
});
7 changes: 5 additions & 2 deletions apps/cli/src/command/sync.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ export const SyncCommand = new BackendCommand<SyncOption>(
command: 'adc sync -f adc.yaml --verbose 2',
},
{
title: 'Synchronize only specified resource types from the configuration file',
command: 'adc sync -f adc.yaml --include-resource-type global_rule --include-resource-type plugin_metadata',
title:
'Synchronize only specified resource types from the configuration file',
command:
'adc sync -f adc.yaml --include-resource-type global_rule --include-resource-type plugin_metadata',
},
{
title: 'Synchronize only the resources with the specified lables',
Expand Down Expand Up @@ -93,6 +95,7 @@ export const SyncCommand = new BackendCommand<SyncOption>(
try {
await tasks.run();
} catch (err) {
if (opts.verbose === 2) console.log(err);
process.exit(1);
}
});

0 comments on commit 569a17f

Please sign in to comment.