heikkivihersalo / gutenberg-native-ai

A plugin that extends the Gutenberg editor with AI features designed to work natively with WordPress.
GNU General Public License v2.0
0 stars 0 forks source link

Add error handling when API keys are missing #32

Open heikkivihersalo opened 1 month ago

heikkivihersalo commented 1 month ago

Currently only following is written to console

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')
    at getText (useChatGPT.ts:55:51)
    at async generateContent (ModalControlsText.tsx:84:21)

Further investigation gives following error

Incorrect API key provided: sk-proj-***********************************. You can find your API key at

Error handling should be added to counter such situations