fix: openai error message

This commit is contained in:
Timothy J. Baek 2023-11-03 19:30:03 -07:00
parent d3b0b8ebd3
commit 4728d426d8

View file

@ -378,10 +378,10 @@
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
toast.error(`OpenAI: ${error.error.message}`); toast.error(`OpenAI: ${error?.error?.message ?? 'Network Problem'}`);
return null; return null;
}); });
const openaiModels = openaiModelRes.data; const openaiModels = openaiModelRes?.data ?? null;
if (openaiModels) { if (openaiModels) {
models = [ models = [