Skip to content

Commit ac9519e

Browse files
Show meaningful error message in benchmark tool (#7990)
1 parent 89a0b8f commit ac9519e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

e2e/benchmarks/model_config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ async function loadModelByUrlWithState(modelUrl, loadOptions = {}, state = {}) {
634634
const artifacts = await ioHandler.load();
635635
modelType = artifacts.format;
636636
} catch (e) {
637-
throw new Error(`Failed to fetch or parse 'model.json' file.`);
637+
console.error(`Failed to fetch or parse 'model.json' file.`);
638+
throw e;
638639
}
639640

640641
// load models
@@ -649,7 +650,8 @@ async function loadModelByUrlWithState(modelUrl, loadOptions = {}, state = {}) {
649650
model = await tryAllLoadingMethods(ioHandler, loadOptions, state);
650651
}
651652
} catch (e) {
652-
throw new Error('Failed to load the model.');
653+
console.error('Failed to load the model.');
654+
throw e;
653655
}
654656

655657
return model;

0 commit comments

Comments
 (0)