Permalink
Browse files

Added more error checking

  • Loading branch information...
1 parent e63b8ac commit 254b9a727ff717ea2e9c16a13c62878229420c23 @gonerandom gonerandom committed Aug 3, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/winston-sqlserver.js
View
@@ -61,6 +61,12 @@ SQLServer.prototype.log = function (level, msg, meta, callback) {
if (err) {
self.emit('error', err);
}
+ if (!results) {
+ self.emit('error', 'results not set');
+ }
+ if (!results.rowcount) {
+ self.emit('error', 'rowcount not set');
+ }
self.emit('logged', results.rowcount);
callback(null, true);

0 comments on commit 254b9a7

Please sign in to comment.