Skip to content

Commit

Permalink
Emit error event in sqlite adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Ng committed Mar 10, 2014
1 parent f062e77 commit 495b3d2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/adapters/sql/sqlite.js
Expand Up @@ -62,10 +62,19 @@ utils.mixin(Adapter.prototype, new (function () {
// Just inherit the base `disconnect` method

this.exec = function (query, callback) {
var self = this;

if (model.log) {
model.log(query);
}
this.client.exec(query, callback);

this.client.exec(query, function (err) {
if(err) {
self.emit('error', err);
}

callback.apply(this, arguments);
});
};

// SQLite makes you choose between a single callback (`all`) and
Expand Down

0 comments on commit 495b3d2

Please sign in to comment.