pg-promise
Advanced tools
Comparing version 0.5.6 to 0.5.7
32
index.js
@@ -372,3 +372,8 @@ // Cannot declare 'use strict' here, because queryResult | ||
} | ||
func(client, req.query, params); // notify the client; | ||
try { | ||
func(client, req.query, params); // notify the client; | ||
} catch (err) { | ||
reject(err); | ||
return; | ||
} | ||
} | ||
@@ -589,23 +594,12 @@ try { | ||
function $notify(open, db, opt) { | ||
if (open) { | ||
if (opt) { | ||
var func = opt.connect; | ||
if (func) { | ||
if (typeof(func) !== 'function') { | ||
throw new Error("Function was expected for 'options.connect'"); | ||
} | ||
func(db.client); // notify the client; | ||
if (opt) { | ||
var func = open ? opt.connect : opt.disconnect; | ||
if (func) { | ||
if (typeof(func) !== 'function') { | ||
throw new Error("Function was expected for 'options." + (open ? "connect'" : "disconnect'")); | ||
} else { | ||
func(db.client); | ||
} | ||
} | ||
} else { | ||
if (opt) { | ||
var func = opt.disconnect; | ||
if (func) { | ||
if (typeof(func) !== 'function') { | ||
throw new Error("Function was expected for 'options.disconnect'"); | ||
} | ||
func(db.client); // notify the client; | ||
} | ||
} | ||
} | ||
} |
{ | ||
"name": "pg-promise", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"description": "PG + Promises/A+, with transactions support.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -466,2 +466,6 @@ pg-promise | ||
Notification happens just before the query execution. And if the notification handler throws | ||
an error, the query execution will be intercepted and rejected with the error that's been | ||
thrown by the handler function. | ||
The function receives the following parameters: | ||
@@ -468,0 +472,0 @@ * `client` - object from the [PG] library that represents the connection; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56348
523
821