add unhandled rejection, demo arg passing
This commit is contained in:
parent
172e312f86
commit
89e957af0f
10
README.md
10
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`.
|
||||
|
|
Loading…
Reference in New Issue