This code was in a sample application that was looking at
process.on('exit', (code) => {
db.close((err) => {
logger.error('Error closing DB: ' + err.message);
});
And it resulted in a consistent crash with the stack trace as shown in the comment on this issue: nodejs/node-addon-api#902 (comment)
My question is whether closeing the db in the exit handler is expected to work or if this is a case of user error