Skip to content

Commit

Permalink
Update openvino.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Jul 21, 2024
1 parent 4bd032d commit 1b1c5a3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions source/openvino.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,15 @@ openvino.ModelFactory = class {
break;
}
case 'openvino.bin': {
const file = `${base}.xml`;
const content = await context.fetch(file, null);
stream = content.stream;
bin = context.stream.peek();
try {
const file = `${base}.xml`;
const content = await context.fetch(file, null);
stream = content.stream;
bin = context.stream.peek();
} catch (error) {
const message = error && error.message ? error.message : error.toString();
throw new openvino.Error(`OpenVINO model definition required (${message.replace(/\.$/, '')}).`);
}
break;
}
default: {
Expand Down

0 comments on commit 1b1c5a3

Please sign in to comment.