catch all config loading errors

This commit is contained in:
Nate 2025-02-04 19:17:42 -08:00
parent f29e1849f3
commit accd5d4b50
5 changed files with 25 additions and 9 deletions

View file

@ -48,7 +48,7 @@
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
"@aws-sdk/credential-providers": "^3.620.1",
"@continuedev/config-types": "^1.0.13",
"@continuedev/config-yaml": "^1.0.23",
"@continuedev/config-yaml": "^1.0.24",
"@continuedev/fetch": "^1.0.4",
"@continuedev/llm-info": "^1.0.2",
"@continuedev/openai-adapters": "^1.0.10",

View file

@ -50,7 +50,9 @@ export class ProfileLifecycleManager {
}
// Clear saved config and reload
async reloadConfig(additionalContextProviders: IContextProvider[] = []): Promise<ConfigResult<ContinueConfig>> {
async reloadConfig(
additionalContextProviders: IContextProvider[] = [],
): Promise<ConfigResult<ContinueConfig>> {
this.savedConfigResult = undefined;
this.savedBrowserConfigResult = undefined;
this.pendingConfigPromise = undefined;
@ -73,7 +75,21 @@ export class ProfileLifecycleManager {
// Set pending config promise
this.pendingConfigPromise = new Promise(async (resolve, reject) => {
const result = await this.profileLoader.doLoadConfig();
let result: ConfigResult<ContinueConfig>;
try {
result = await this.profileLoader.doLoadConfig();
} catch (e: any) {
result = {
errors: [
{
fatal: true,
message: e.message,
},
],
config: undefined,
configLoadInterrupted: true,
};
}
if (result.config) {
// Add registered context providers

View file

@ -21,9 +21,9 @@ import { getConfigJsonPath, getConfigYamlPath } from "../../util/paths";
import { Telemetry } from "../../util/posthog";
import { TTS } from "../../util/tts";
import { loadContinueConfigFromJson } from "../load";
import { migrateJsonSharedConfig } from "../migrateSharedConfig";
import { loadContinueConfigFromYaml } from "../yaml/loadYaml";
import { PlatformConfigMetadata } from "./PlatformProfileLoader";
import { migrateJsonSharedConfig } from "../migrateSharedConfig";
export default async function doLoadConfig(
ide: IDE,

View file

@ -13,7 +13,7 @@
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
"@aws-sdk/credential-providers": "^3.620.1",
"@continuedev/config-types": "^1.0.13",
"@continuedev/config-yaml": "^1.0.23",
"@continuedev/config-yaml": "^1.0.24",
"@continuedev/fetch": "^1.0.4",
"@continuedev/llm-info": "^1.0.2",
"@continuedev/openai-adapters": "^1.0.10",
@ -3038,9 +3038,9 @@
}
},
"node_modules/@continuedev/config-yaml": {
"version": "1.0.23",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.23.tgz",
"integrity": "sha512-F2Hwc85iCwAHJuwJALOsmZIBeHdF+87mS0YT7dlC6QiE+zAhZKUHcLQ/nTt9bJuhyVyufpb9LApkp40UdGsaWw==",
"version": "1.0.24",
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.24.tgz",
"integrity": "sha512-xA4tRUh9r9p3aHIXr9zl5GQd5VygEusIc7Zw7AAFCbbl6ahMB4CDcweT8+iz0UvxJ11PLYizFSygpvxu/Yl19Q==",
"dependencies": {
"@continuedev/config-types": "^1.0.14",
"yaml": "^2.6.1",

View file

@ -46,7 +46,7 @@
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
"@aws-sdk/credential-providers": "^3.620.1",
"@continuedev/config-types": "^1.0.13",
"@continuedev/config-yaml": "^1.0.23",
"@continuedev/config-yaml": "^1.0.24",
"@continuedev/fetch": "^1.0.4",
"@continuedev/llm-info": "^1.0.2",
"@continuedev/openai-adapters": "^1.0.10",