File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,15 @@ export async function migrateSettings(
4040 const customInstructionsFilePath = path . join ( settingsDir , GlobalFileNames . customInstructions )
4141
4242 if ( customInstructionsContent && ! ( await fileExistsAtPath ( customInstructionsFilePath ) ) ) {
43- await fs . writeFile ( customInstructionsFilePath , customInstructionsContent , "utf-8" )
44- await context . globalState . update ( customInstructionsKey , undefined ) // Delete from GlobalState
45- outputChannel . appendLine ( "Migrated custom instructions from GlobalState to file." )
43+ try {
44+ await fs . writeFile ( customInstructionsFilePath , customInstructionsContent , "utf-8" )
45+ await context . globalState . update ( customInstructionsKey , undefined ) // Delete from GlobalState
46+ outputChannel . appendLine ( "Migrated custom instructions from GlobalState to file." )
47+ } catch ( migrationError ) {
48+ outputChannel . appendLine (
49+ `Error migrating custom instructions: ${ migrationError } . Data might still be in GlobalState.` ,
50+ )
51+ }
4652 } else {
4753 outputChannel . appendLine (
4854 `Skipping custom instructions migration: ${ customInstructionsContent ? "file already exists" : "no data in GlobalState" } ` ,
You can’t perform that action at this time.
0 commit comments