Skip to content
Browse files

Make the callback api have room for the error parameter.

  • Loading branch information...
1 parent 72c2783 commit 3583c3a06e495b973931e9910ca42313cb6c800d @creationix committed Aug 20, 2010
Showing with 5 additions and 5 deletions.
  1. +4 −4 lib/postgres-pure.js
  2. +1 −1 lib/sql.js
View
8 lib/postgres-pure.js
@@ -386,7 +386,7 @@ function Connection(args) {
}
});
events.addListener('CommandComplete', function (data) {
- query_callback.call(this, results);
+ query_callback.call(this, null, results);
});
conn.execute = function (sql/*, *parameters*/) {
@@ -428,8 +428,8 @@ function Connection(args) {
callback();
}});
} else {
- query_queue.push({sql: sql, callback: function (data) {
- callback(data);
+ query_queue.push({sql: sql, callback: function (err, data) {
+ callback(err, data);
}});
}
@@ -458,7 +458,7 @@ Connection.prototype.get_store = function (name, columns) {
" RETURNING _id",
function (result) {
data._id = parseInt(result[0]._id, 10);
- callback(data._id);
+ callback(null, data._id);
}
);
},
View
2 lib/sql.js
@@ -137,7 +137,7 @@ Store.prototype = {
this.conn.query(
"SELECT " + this.index_col + " AS _id, * FROM " + this.name + " WHERE " + this.index_col + " = ?", id,
function (data) {
- callback(data[0]);
+ callback(null, data[0]);
}
);
},

0 comments on commit 3583c3a

Please sign in to comment.
Something went wrong with that request. Please try again.