Fix recoverable exception in mesh accelerator.

This commit is contained in:
Ylian Saint-Hilaire 2023-10-29 18:01:37 -07:00
parent e0d73b2fcd
commit fed8f021f2
1 changed files with 14 additions and 1 deletions

View File

@ -32,7 +32,20 @@ module.exports.processMessage = function(message) {
const sign = crypto.createSign('SHA384');
sign.end(Buffer.from(message.data, 'binary'));
process.send(sign.sign(message.key).toString('binary'));
} catch (e) { process.send(null); }
} catch (ex) {
// If this exception happens, try again.
if (ex.code == 'ERR_OSSL_DSO_COULD_NOT_LOAD_THE_SHARED_LIBRARY') {
try {
const sign = crypto.createSign('SHA384');
sign.end(Buffer.from(message.data, 'binary'));
process.send(sign.sign(message.key).toString('binary'));
} catch (ex) {
process.send(null);
}
} else {
process.send(null);
}
}
break;
}
case 'setState': {