From 9f1448ee1e72a7836fd6792c7d393fa4300b3cd1 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Mon, 3 Aug 2026 17:04:43 +0530 Subject: [PATCH] fix: surface real create-job failure reason instead of generic error Backend now returns JSON error bodies with a code field for every create_job failure branch. Special-case QUOTA_EXHAUSTED with an actionable message since there's no self-serve job-slot purchase flow yet (support has to grant slots manually). Co-Authored-By: Claude Sonnet 5 --- src/components/dashboard/CompanyJobsPage.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/dashboard/CompanyJobsPage.tsx b/src/components/dashboard/CompanyJobsPage.tsx index 1222aa5..cda3130 100644 --- a/src/components/dashboard/CompanyJobsPage.tsx +++ b/src/components/dashboard/CompanyJobsPage.tsx @@ -284,7 +284,11 @@ export default function CompanyJobsPage() { }); const data = await res.json().catch(() => ({})); if (!res.ok) { - setError(data.error ?? data.message ?? "Failed to create job."); + if (data.code === "QUOTA_EXHAUSTED") { + setError("You've used your free job post for this month. Contact support to purchase additional job slots."); + } else { + setError(data.error ?? data.message ?? "Failed to create job."); + } return; } setActionMsg("Job created as draft.");