fix: enhance error logging for JSON parsing in suggestions generation

- Added error logging for failed JSON parsing in the suggestions generation route to improve debugging capabilities.
- This change ensures that any parsing errors are captured and logged, aiding in the identification of issues with AI response handling.
This commit is contained in:
Cody Seibert
2025-12-14 18:18:21 -05:00
parent 6733de9e0d
commit 4405a97d9b
4 changed files with 7 additions and 15 deletions

View File

@@ -3,18 +3,15 @@
*/
import type { Request, Response } from "express";
import {
getApiKey,
getErrorMessage,
logError,
} from "../common.js";
import { getApiKey, getErrorMessage, logError } from "../common.js";
export function createApiKeysHandler() {
return async (_req: Request, res: Response): Promise<void> => {
try {
res.json({
success: true,
hasAnthropicKey: !!getApiKey("anthropic") || !!process.env.ANTHROPIC_API_KEY,
hasAnthropicKey:
!!getApiKey("anthropic") || !!process.env.ANTHROPIC_API_KEY,
hasGoogleKey: !!getApiKey("google") || !!process.env.GOOGLE_API_KEY,
});
} catch (error) {