diff --git a/apps/app/components/core/modals/gpt-assistant-modal.tsx b/apps/app/components/core/modals/gpt-assistant-modal.tsx index f1b24c65b..7c05e036a 100644 --- a/apps/app/components/core/modals/gpt-assistant-modal.tsx +++ b/apps/app/components/core/modals/gpt-assistant-modal.tsx @@ -117,18 +117,21 @@ export const GptAssistantModal: React.FC = ({ else setInvalidResponse(false); }) .catch((err) => { + const error = err?.data?.error; + if (err.status === 429) setToastAlert({ type: "error", title: "Error!", message: + error || "You have reached the maximum number of requests of 50 requests per month per user.", }); else setToastAlert({ type: "error", title: "Error!", - message: "Some error occurred. Please try again.", + message: error || "Some error occurred. Please try again.", }); }); }; diff --git a/apps/app/components/issues/form.tsx b/apps/app/components/issues/form.tsx index 1a87ac9fe..e6fc11ae2 100644 --- a/apps/app/components/issues/form.tsx +++ b/apps/app/components/issues/form.tsx @@ -202,18 +202,21 @@ export const IssueForm: FC = ({ else handleAiAssistance(res.response_html); }) .catch((err) => { + const error = err?.data?.error; + if (err.status === 429) setToastAlert({ type: "error", title: "Error!", message: + error || "You have reached the maximum number of requests of 50 requests per month per user.", }); else setToastAlert({ type: "error", title: "Error!", - message: "Some error occurred. Please try again.", + message: error || "Some error occurred. Please try again.", }); }) .finally(() => setIAmFeelingLucky(false));