diff --git a/README.md b/README.md index ff305ce..85a09ac 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ var opts = { sqlite.create(opts).then(function (db) { // same api as new sqlite3.Database(options.filename) - client.run("SELECT 1", [], function (err) { + client.run("SELECT ?", ['Hello World!'], function (err) { if (err) { console.error('[ERROR]', cluster.isMaster && '0' || cluster.worker.id); console.error(err); @@ -61,6 +61,14 @@ sqlite.create(opts).then(function (db) { console.log(this); }); }); + +process.on('unhandledPromiseRejection', function (err) { + console.error('Unhandled Promise Rejection'); + console.error(err); + console.error(err.stack); + + throw err; +}); ``` If you wish to always use clustering, even on a single core system, see `test-cluster.js`.