mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-07-08 11:56:59 +00:00
Clarify empty AI reply errors
This commit is contained in:
@@ -3753,7 +3753,11 @@ import { bindMenuDismiss, dismissOrRemove } from './escMenuStack.js';
|
||||
await _streamEmailBodyText(textarea, newBody);
|
||||
if (uiModule) uiModule.showToast(`AI draft inserted (${data.model_used || 'AI'})`);
|
||||
} else {
|
||||
if (uiModule) uiModule.showError(data.error || 'Failed to generate reply');
|
||||
const rawMsg = data.error || 'Failed to generate reply';
|
||||
const msg = /empty response/i.test(rawMsg)
|
||||
? 'AI reply failed: AI returned empty response.'
|
||||
: rawMsg;
|
||||
if (uiModule) uiModule.showError(msg);
|
||||
}
|
||||
} catch (e) {
|
||||
if (uiModule) uiModule.showError('Failed to generate AI reply');
|
||||
|
||||
@@ -804,7 +804,10 @@ async function _openEmail(em, itemEl, preloadedData = null, mode = 'reply', note
|
||||
if (result.success && result.reply) {
|
||||
aiSuggestedBody = _cleanAiReplyText(result.reply);
|
||||
} else {
|
||||
const _msg = result.error || 'AI reply could not be generated';
|
||||
const _rawMsg = result.error || 'AI reply could not be generated';
|
||||
const _msg = /empty response/i.test(_rawMsg)
|
||||
? 'AI returned empty response.'
|
||||
: _rawMsg;
|
||||
console.error('AI reply generation failed:', _msg);
|
||||
import('./ui.js').then(m => m.showError && m.showError('AI reply failed: ' + _msg)).catch(() => {});
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user