Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

refactor: update error logging for Ollama connection checks and tags fetching

Khuram Niaz85adeb6eacb0
diff --git a/src/app/api/ai/ollama/tags/route.ts b/src/app/api/ai/ollama/tags/route.ts
index d6d8e8e..95b3849 100644
--- a/src/app/api/ai/ollama/tags/route.ts
+++ b/src/app/api/ai/ollama/tags/route.ts
@@ -24,7 +24,7 @@ export async function GET() {
const data = await response.json();
return NextResponse.json(data);
} catch (error) {
- console.error("Error proxying Ollama tags:", error);
+ console.warn("Ollama tags unreachable:", error);
return NextResponse.json(
{ error: "Cannot connect to Ollama service" },
{ status: 502 },
diff --git a/src/components/profile/ResumeContainer.tsx b/src/components/profile/ResumeContainer.tsx
index 89f5578..2cf1b4a 100644
--- a/src/components/profile/ResumeContainer.tsx
+++ b/src/components/profile/ResumeContainer.tsx
@@ -46,9 +46,8 @@ import {
import { deleteResumeById } from "@/actions/profile.actions";
import { resolveImportCard, ImportCardPayload } from "@/actions/resumeImport.actions";
import { ResumeImportData } from "@/models/resumeImport.schema";
-import { AiModel, AiProvider, defaultModel } from "@/models/ai.model";
+import { AiModel, defaultModel } from "@/models/ai.model";
import { getUserSettings } from "@/actions/userSettings.actions";
-import { checkOllamaConnection } from "@/utils/ai.utils";
type PendingCard = {
id: string;
@@ -295,11 +294,7 @@ function ResumeContainer({ resume }: { resume: Resume }) {
const ai = result.data.settings.ai;
const model: AiModel = { provider: ai.provider || defaultModel.provider, model: ai.model };
setAiModel(model);
- if (model.provider === AiProvider.OLLAMA) {
- checkOllamaConnection(AiProvider.OLLAMA).then((r) => setAiReady(r.isConnected));
- } else {
- setAiReady(true);
- }
+ setAiReady(true);
}
});
}
diff --git a/src/utils/ai.utils.ts b/src/utils/ai.utils.ts
index 3c4d352..ad5ee96 100644
--- a/src/utils/ai.utils.ts
+++ b/src/utils/ai.utils.ts
@@ -33,7 +33,7 @@ export const checkOllamaConnection = async (
return { isConnected: true };
} catch (error) {
- console.error("Error checking Ollama connection:", error);
+ console.warn("Ollama connection check failed:", error);
const errorMessage =
error instanceof Error ? error.message : "Unknown error";
return {