Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Frontend fetch calls now check `response.ok` before parsing JSON, so HTTP error responses surface as error states instead of being parsed as data (#27).

## [0.2.0] - 2026-04-16

### Added
Expand Down
15 changes: 15 additions & 0 deletions web/vanilla/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class LanceViewer {
async checkHealth() {
try {
const response = await fetch(`${this.apiBase}/healthz`);
if (!response.ok) {
throw new Error(`API error: ${response.status} ${response.statusText}`);
}
const data = await response.json();
if (data.ok) {
// Show Lance version prominently along with app version
Expand All @@ -93,6 +96,9 @@ class LanceViewer {
async loadDatasets() {
try {
const response = await fetch(`${this.apiBase}/datasets`);
if (!response.ok) {
throw new Error(`API error: ${response.status} ${response.statusText}`);
}
const data = await response.json();

this.elements.datasetList.innerHTML = '';
Expand Down Expand Up @@ -134,6 +140,9 @@ class LanceViewer {
async loadSchema() {
try {
const response = await fetch(`${this.apiBase}/datasets/${this.currentDataset}/schema`);
if (!response.ok) {
throw new Error(`API error: ${response.status} ${response.statusText}`);
}
const schema = await response.json();

this.elements.schemaDisplay.innerHTML = '';
Expand Down Expand Up @@ -167,6 +176,9 @@ class LanceViewer {
async loadColumns() {
try {
const response = await fetch(`${this.apiBase}/datasets/${this.currentDataset}/columns`);
if (!response.ok) {
throw new Error(`API error: ${response.status} ${response.statusText}`);
}
const data = await response.json();

this.allColumns = data.columns;
Expand Down Expand Up @@ -225,6 +237,9 @@ class LanceViewer {
}

const response = await fetch(`${this.apiBase}/datasets/${this.currentDataset}/rows?${params}`);
if (!response.ok) {
throw new Error(`API error: ${response.status} ${response.statusText}`);
}
const data = await response.json();

this.totalRows = data.total;
Expand Down
Loading