Update v1.ts
Some checks failed
Deploy Images to GHCR / push-app-image (push) Has been cancelled

This commit is contained in:
Nicolas 2024-10-17 17:57:44 -03:00
parent dff71a8179
commit 79e65f31ef

View File

@ -36,7 +36,7 @@ function checkCreditsMiddleware(minimum?: number): (req: RequestWithAuth, res: R
if (!success) {
Logger.error(`Insufficient credits: ${JSON.stringify({ team_id: req.auth.team_id, minimum, remainingCredits })}`);
if (!res.headersSent) {
return res.status(402).json({ success: false, error: "Insufficient credits. For more credits, you can upgrade your plan at https://firecrawl.dev/pricing." });
return res.status(402).json({ success: false, error: "Insufficient credits to perform this request. For more credits, you can upgrade your plan at https://firecrawl.dev/pricing or try changing the request limit to a lower value." });
}
}
req.account = { remainingCredits };