Skip to content

Commit 03356cb

Browse files
committed
fix: throw error on nested JSON parse failure to prevent silent data loss (CodeRabbit review)
1 parent c8cc355 commit 03356cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/cli/src/cli/localizer/explicit.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ function createAiSdkLocalizer(params: {
309309
console.error(
310310
`Failed to parse nested JSON response. Snippet: ${result.data.slice(0, 100)}...`,
311311
);
312-
// Fallback to empty object or continue
312+
throw new Error(
313+
`Failed to parse nested JSON response: ${e} (Snippet: ${result.data.slice(0, 100)}...)`,
314+
);
313315
}
314316
}
315317
}

0 commit comments

Comments
 (0)