From 89e957af0f46dc26fde1206ffb08a69185409eb4 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 24 Jul 2015 16:10:47 -0600 Subject: [PATCH] add unhandled rejection, demo arg passing --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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`.