Fix: catch uncaught OpenAIError handling in server index.js and log info (#1248)

This commit is contained in:
Danny Avila
2023-11-30 13:29:55 -05:00
committed by GitHub
parent 94df631c44
commit 53d0ffcd11

View File

@@ -101,7 +101,16 @@ process.on('uncaughtException', (err) => {
console.error('Meilisearch error, search will be disabled');
messageCount++;
}
} else {
process.exit(1);
return;
}
if (err.message.includes('OpenAIError')) {
console.error(
'\n\nAn Uncaught `OpenAIError` error may be due to your reverse-proxy setup or stream configuration, or a bug in the `openai` node package.',
);
return;
}
process.exit(1);
});