[mirotalksfu] - fix ChatGPT handle error

هذا الالتزام موجود في:
Miroslav Pejic
2024-01-21 14:42:13 +01:00
الأصل 47c2c20b07
التزام fc14a567a7

عرض الملف

@@ -1261,8 +1261,9 @@ function startServer() {
});
cb(response);
} catch (error) {
if (error instanceof OpenAI.APIError) {
if (error.name === 'APIError') {
log.error('ChatGPT', {
name: error.name,
status: error.status,
message: error.message,
code: error.code,
@@ -1272,7 +1273,7 @@ function startServer() {
} else {
// Non-API error
log.error('ChatGPT', error);
cb(error);
cb(error.message);
}
}
});