Show FastAPI error detail in conversation error bubbles
This commit is contained in:
parent
b3a408bfd9
commit
00ffb52799
@ -427,7 +427,7 @@ $('s-import-voices-file')?.addEventListener('change', async function () {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const resp = await fetch('/api/conversation/turn', { method: 'POST', body: form });
|
const resp = await fetch('/api/conversation/turn', { method: 'POST', body: form });
|
||||||
if (!resp.ok) throw new Error('Server error ' + resp.status);
|
if (!resp.ok) { let _d=''; try { const _j=await resp.json(); _d=JSON.stringify(_j.detail||_j); } catch(_){} throw new Error('Server error ' + resp.status + (_d ? ': ' + _d : '')); }
|
||||||
const reader = resp.body.getReader();
|
const reader = resp.body.getReader();
|
||||||
const dec = new TextDecoder();
|
const dec = new TextDecoder();
|
||||||
let buf = '';
|
let buf = '';
|
||||||
@ -539,7 +539,7 @@ $('s-import-voices-file')?.addEventListener('change', async function () {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const resp = await fetch('/api/conversation/turn', { method: 'POST', body: form });
|
const resp = await fetch('/api/conversation/turn', { method: 'POST', body: form });
|
||||||
if (!resp.ok) throw new Error('Server error ' + resp.status);
|
if (!resp.ok) { let _d=''; try { const _j=await resp.json(); _d=JSON.stringify(_j.detail||_j); } catch(_){} throw new Error('Server error ' + resp.status + (_d ? ': ' + _d : '')); }
|
||||||
const reader = resp.body.getReader();
|
const reader = resp.body.getReader();
|
||||||
const dec = new TextDecoder();
|
const dec = new TextDecoder();
|
||||||
let buf = '';
|
let buf = '';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user