Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: output more logs when errors happened #187

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
});
Loading