Do not throw an Error embedding another Error

Should fix #68, but doesn't come with an automated test
This commit is contained in:
Sandro Santilli 2013-02-08 12:27:49 +01:00
parent 7d34cbbd63
commit 6b71cde56e

View File

@ -106,7 +106,7 @@ module.exports = function() {
if (check_result === 1) {
// authorized by key, login as db owner
that.getId(req, function(err, user_id) {
if (err) throw new Error(err);
if (err) throw err;
var dbuser = _.template(global.settings.postgres_auth_user, {user_id: user_id});
_.extend(req, {dbuser:dbuser});
callback(err, true);