Skip to content

Commit 7658f4c

Browse files
committed
bench: Fail gracefully if function_call binding fails
1 parent 0e59efd commit 7658f4c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

benchmark/misc/function_call/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@
66
var assert = require('assert');
77
var common = require('../../common.js');
88

9-
var binding = require('./build/Release/binding');
9+
// this fails when we try to open with a different version of node,
10+
// which is quite common for benchmarks. so in that case, just
11+
// abort quietly.
12+
13+
try {
14+
var binding = require('./build/Release/binding');
15+
} catch (er) {
16+
console.error('misc/function_call.js Binding failed to load');
17+
process.exit(0);
18+
}
1019
var cxx = binding.hello;
1120

1221
var c = 0;

0 commit comments

Comments
 (0)