forked from github/plane
chore: ai assistant limit error (#619)
This commit is contained in:
parent
70a00a6309
commit
bc7dc43171
@ -91,6 +91,21 @@ export const GptAssistantModal: React.FC<Props> = ({
|
||||
|
||||
if (res.response === "") setInvalidResponse(true);
|
||||
else setInvalidResponse(false);
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err.status === 429)
|
||||
setToastAlert({
|
||||
type: "error",
|
||||
title: "Error!",
|
||||
message:
|
||||
"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.",
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -18,7 +18,7 @@ class AiServices extends APIService {
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/projects/${projectId}/ai-assistant/`, data)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
throw error?.response;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user