All fetch() calls in app.js call response.json() without first checking response.ok. If the backend returns a 4xx or 5xx error, the error JSON is silently parsed as valid data, which can cause confusing behavior in the UI.
Example (current):
const response = await fetch(`/datasets/${name}/rows?...`);
const data = await response.json();
// data might be an error object, but we treat it as row data
Proposed fix: Add a guard before each .json() call:
const response = await fetch(`/datasets/${name}/rows?...`);
if (!response.ok) {
throw new Error(`API error: ${response.status} ${response.statusText}`);
}
const data = await response.json();
Applies to every fetch() call in app.js.
All
fetch()calls inapp.jscallresponse.json()without first checkingresponse.ok. If the backend returns a 4xx or 5xx error, the error JSON is silently parsed as valid data, which can cause confusing behavior in the UI.Example (current):
Proposed fix: Add a guard before each
.json()call:Applies to every
fetch()call inapp.js.