Skip to content

Commit

Permalink
resolve: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vpbs2 authored and ujaval403 committed Jul 1, 2024
1 parent 353cc47 commit 4068771
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/duckdb-wasm/src/bindings/bindings_browser_eh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import DuckDBWasm from './duckdb-eh.js';
import { DuckDBBrowserBindings } from './bindings_browser_base';
import { DuckDBModule } from './duckdb_module';
import { DuckDBRuntime } from './runtime';
import { Logger } from '../log';
import { LogEvent, LogLevel, LogOrigin, LogTopic, Logger } from '../log';

/** DuckDB bindings for the browser */
export class DuckDB extends DuckDBBrowserBindings {
Expand All @@ -27,9 +27,17 @@ export class DuckDB extends DuckDBBrowserBindings {
instantiateWasm: wasm,
locateFile: locateFile,
});
} catch (e) {
console.error(e);
throw e;
} catch (error : any) {
this.logger.log({
timestamp: new Date(),
level: LogLevel.ERROR,
origin: LogOrigin.BINDINGS,
topic: LogTopic.INSTANTIATE,
event: LogEvent.ERROR,
value: 'Failed to instantiate WASM: ' + error,
});

throw error;
}
}
}
Expand Down

0 comments on commit 4068771

Please sign in to comment.