diff options
| author | Taylor Mullen <[email protected]> | 2025-05-09 10:20:08 -0700 |
|---|---|---|
| committer | N. Taylor Mullen <[email protected]> | 2025-05-09 10:28:20 -0700 |
| commit | b8fa38a6e8f60acf6489fde545a91d3ba4c395d7 (patch) | |
| tree | 9f5950e4bf5c644a9890786a43243e2859ad3642 /packages/cli/src/gemini.ts | |
| parent | c58f8790265fc80b52dbba1127f2c2e5b90ef737 (diff) | |
feat: Improve theme not found handling
Modify to return a boolean instead of throwing an error when a theme is not found. Update CLI startup and hook to handle the boolean return value for more graceful error handling.
Diffstat (limited to 'packages/cli/src/gemini.ts')
| -rw-r--r-- | packages/cli/src/gemini.ts | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/packages/cli/src/gemini.ts b/packages/cli/src/gemini.ts index 32e34c20..1f48a99b 100644 --- a/packages/cli/src/gemini.ts +++ b/packages/cli/src/gemini.ts @@ -24,23 +24,10 @@ async function main() { const settings = loadSettings(process.cwd()); const config = await loadCliConfig(settings.merged); if (settings.merged.theme) { - try { - themeManager.setActiveTheme(settings.merged.theme); - } catch (error: unknown) { + if (!themeManager.setActiveTheme(settings.merged.theme)) { // If the theme is not found during initial load, log a warning and continue. // The useThemeCommand hook in App.tsx will handle opening the dialog. - if ( - error instanceof Error && - error.message.includes('Theme') && - error.message.includes('not found') - ) { - console.warn( - `Warning: ${error instanceof Error ? error.message : String(error)}`, - ); - } else { - // Re-throw other errors to be caught by the main catch block - throw error; - } + console.warn(`Warning: Theme "${settings.merged.theme}" not found.`); } } |
