fix: show extract API errors in UI instead of false 'Extraction complete'
doExtract() only checked data.message, so JSON responses with error key (e.g. 'no ISO files found') would show green success. Now checks data.error first and displays it in red.
This commit is contained in:
@@ -175,6 +175,11 @@ async function doExtract() {
|
||||
try {
|
||||
const resp = await fetch(`${API}/extract?dir=${encodeURIComponent(isoDir)}&out=${encodeURIComponent(wavDir)}`);
|
||||
const data = await resp.json();
|
||||
if (data.error) {
|
||||
status.textContent = data.error;
|
||||
status.style.color = 'var(--accent)';
|
||||
return;
|
||||
}
|
||||
status.textContent = data.message || 'Extraction complete';
|
||||
status.style.color = 'var(--green)';
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user