Skip to content

Commit 46043c6

Browse files
authored
Update error response and logs
1 parent d9a36a8 commit 46043c6

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

src/app.ts

+4-20
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,14 @@ async function handleChatCompletion(req: Request, res: Response) {
236236
let session = await getNewSession();
237237

238238
if (!session) {
239+
console.error("Error getting a new session...");
240+
console.error("If this error persists, your country may not be supported yet.");
241+
console.error("If your country was the issue, please consider using a U.S. VPN or a U.S. residential proxy.");
239242
res.write(
240243
JSON.stringify({
241244
status: false,
242245
error: {
243-
message: `Error getting a new session, please try again later, if the issue persists, please open an issue on the GitHub repository, https://github.com/PawanOsman/ChatGPT`,
246+
message: `Error getting a new session, If this error persists, your country may not be supported yet. If your country was the issue, please consider using a U.S. VPN or a U.S. residential proxy.`,
244247
type: "invalid_request_error",
245248
},
246249
support: "https://discord.pawan.krd",
@@ -596,23 +599,4 @@ app.listen(port, async () => {
596599
console.log(
597600
`💖 Don't forget to star the repository if you like this project!`
598601
);
599-
console.log();
600-
601-
setTimeout(async () => {
602-
while (true) {
603-
try {
604-
await getNewSession();
605-
await wait(refreshInterval);
606-
} catch (error) {
607-
console.error("Error refreshing session ID, retrying in 2 minute...");
608-
console.error(
609-
"If this error persists, your country may not be supported yet."
610-
);
611-
console.error(
612-
"If your country was the issue, please consider using a U.S. VPN."
613-
);
614-
await wait(errorWait);
615-
}
616-
}
617-
}, 0);
618602
});

0 commit comments

Comments
 (0)