warnings on config load
This commit is contained in:
parent
6e4b4bb264
commit
ff1d113862
2 changed files with 10 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ import {
|
|||
DefaultApi,
|
||||
DefaultApiInterface,
|
||||
} from "@continuedev/sdk/dist/api/dist/index.js";
|
||||
import chalk from "chalk";
|
||||
import { dirname } from "node:path";
|
||||
import {
|
||||
AuthConfig,
|
||||
|
|
@ -97,9 +98,15 @@ async function loadConfigYaml(
|
|||
}
|
||||
);
|
||||
|
||||
if (unrollResult.errors?.length || !unrollResult.config) {
|
||||
const errorDetails = unrollResult.errors?.join("\n") ?? "Unknown error";
|
||||
const errorDetails = unrollResult.errors;
|
||||
if (!unrollResult.config) {
|
||||
throw new Error(`Failed to load config file:\n${errorDetails}`);
|
||||
} else if (errorDetails?.length) {
|
||||
const warnings =
|
||||
errorDetails?.length > 1
|
||||
? errorDetails.map((d) => `\n- ${d.message}`)
|
||||
: errorDetails[0].message;
|
||||
console.warn(chalk.dim(`Warning: ${warnings}`));
|
||||
}
|
||||
|
||||
return unrollResult.config;
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ export async function runOnboardingFlow(
|
|||
limitMessage: chalk.dim(
|
||||
"Please enter a valid Anthropic key that starts with 'sk-ant'"
|
||||
),
|
||||
hideEchoBack: true,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue