Skip to content

Commit af2f599

Browse files
strickvlclaude
andcommitted
refactor: simplify loadCustomStrings function signature and error handling
Make customStringsArg parameter required since caller already checks existence. Remove redundant try-catch block in main.ts to avoid duplicate error logging since loadCustomStrings already provides descriptive error messages. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b275d52 commit af2f599

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/node/i18n/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ const defaultResources = {
2525
}
2626

2727

28-
export async function loadCustomStrings(customStringsArg?: string): Promise<void> {
29-
if (!customStringsArg) {
30-
return
31-
}
28+
export async function loadCustomStrings(customStringsArg: string): Promise<void> {
3229

3330
try {
3431
let customStringsData: Record<string, any>

src/node/main.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,8 @@ export const runCodeServer = async (
125125

126126
// Load custom strings if provided
127127
if (args["custom-strings"]) {
128-
try {
129-
await loadCustomStrings(args["custom-strings"])
130-
logger.info("Loaded custom strings")
131-
} catch (error) {
132-
logger.error("Failed to load custom strings", field("error", error))
133-
throw error
134-
}
128+
await loadCustomStrings(args["custom-strings"])
129+
logger.info("Loaded custom strings")
135130
}
136131

137132
logger.info(`Using user-data-dir ${args["user-data-dir"]}`)

0 commit comments

Comments
 (0)