Merge pull request #7523 from continuedev/fix-config-load
fix: Don't fail on non-fatal errors in CLI
This commit is contained in:
commit
8e8ffcaf37
1 changed files with 16 additions and 3 deletions
|
|
@ -229,9 +229,18 @@ async function loadUserAssistantWithFallback(
|
|||
|
||||
if (assistants.length > 0) {
|
||||
const result = assistants[0].configResult;
|
||||
if (result.errors?.length || !result.config) {
|
||||
if (!result.config) {
|
||||
throw new Error(result.errors?.join("\n") ?? "Failed to load assistant.");
|
||||
}
|
||||
|
||||
const errors = result.errors;
|
||||
if (errors?.some((e: any) => e.fatal)) {
|
||||
throw new Error(
|
||||
errors.map((e: any) => e.message).join("\n") ??
|
||||
"Failed to load assistant.",
|
||||
);
|
||||
}
|
||||
|
||||
return result.config as AssistantUnrolled;
|
||||
}
|
||||
|
||||
|
|
@ -373,8 +382,12 @@ async function loadAssistantSlug(
|
|||
});
|
||||
|
||||
const result = resp.configResult;
|
||||
if (result.errors?.length || !result.config) {
|
||||
throw new Error(result.errors?.join("\n") ?? "Failed to load assistant.");
|
||||
const errors = result.errors;
|
||||
if (errors?.some((e: any) => e.fatal)) {
|
||||
throw new Error(
|
||||
errors.map((e: any) => e.message).join("\n") ??
|
||||
"Failed to load assistant.",
|
||||
);
|
||||
}
|
||||
|
||||
return result.config as AssistantUnrolled;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue