From a77f5d0c49d9e21668b53055e99311f0e594ba9f Mon Sep 17 00:00:00 2001 From: simaonogueira101 Date: Wed, 11 Feb 2026 16:25:45 +0000 Subject: [PATCH 1/2] feat: Improve 403 error message for Pro subscription requirements Update the AI-friendly error message for forbidden responses to provide specific guidance about subscribing at the pricing page instead of a generic access denial message. Co-authored-by: Cursor --- src/errors.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/errors.ts b/src/errors.ts index a5566c3..aa398eb 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -56,7 +56,8 @@ export function toAIFriendlyError(error: unknown): { }; if (msg.includes("403") || msg.includes("Pro organization required")) return { - message: "Pro organization required. Your account may not have access.", + message: + "Pro subscription required. Subscribe at https://pro.talent.app/pricing or check your organization's billing status.", code: "AUTH_ERROR", }; if (msg.includes("rate_limit")) From 93ff2fb753e9b8ecf0cc781623cb0a9c689375c4 Mon Sep 17 00:00:00 2001 From: simaonogueira101 Date: Wed, 11 Feb 2026 16:41:29 +0000 Subject: [PATCH 2/2] test: Add tests for 403 Pro subscription error message Cover the updated AI-friendly error message that directs users to the pricing page and billing status when hitting Pro subscription barriers. Co-authored-by: Cursor --- src/errors.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/errors.test.ts b/src/errors.test.ts index 6c3e501..bd91d83 100644 --- a/src/errors.test.ts +++ b/src/errors.test.ts @@ -94,6 +94,25 @@ describe("toAIFriendlyError", () => { expect(result.message).toContain("Retry"); }); + it("handles 403 Forbidden errors with subscription guidance", () => { + const result = toAIFriendlyError( + new Error("Request failed with status 403"), + ); + + expect(result.code).toBe("AUTH_ERROR"); + expect(result.message).toContain("Pro subscription required"); + expect(result.message).toContain("pro.talent.app/pricing"); + expect(result.message).toContain("billing status"); + }); + + it("handles Pro organization required errors with subscription guidance", () => { + const result = toAIFriendlyError(new Error("Pro organization required")); + + expect(result.code).toBe("AUTH_ERROR"); + expect(result.message).toContain("Pro subscription required"); + expect(result.message).toContain("pro.talent.app/pricing"); + }); + it("returns UNKNOWN_ERROR for unrecognized errors", () => { const result = toAIFriendlyError( new Error("Something unexpected happened"),