mssql-cr-layer 2.0.17 → 2.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/src/index.js +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mssql-cr-layer",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "description": "A MS SQL Server interface layer for common requests",
5
5
  "repository": "andrglo/mssql-cr-layer",
6
6
  "author": {
@@ -34,6 +34,7 @@
34
34
  },
35
35
  "license": "MIT",
36
36
  "dependencies": {
37
+ "debug": "^4.3.4",
37
38
  "lodash.every": "^4.6.0",
38
39
  "mssql": "^9.1.1"
39
40
  }
package/src/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const mssql = require('mssql')
2
2
  const assert = require('assert')
3
3
  const every = require('lodash.every')
4
+ const debug = require('debug')('layer:mssql')
4
5
 
5
6
  const connectionParams = new WeakMap() // Hidden connection parameters
6
7
 
@@ -164,6 +165,10 @@ MssqlCrLayer.prototype.batch = function(script, options) {
164
165
  .then(function({recordset}) {
165
166
  return recordset ? recordset.map(fold) : []
166
167
  })
168
+ .catch(err => {
169
+ debug('%s %O', script, err)
170
+ throw err
171
+ })
167
172
  }
168
173
  )
169
174
  }
@@ -200,6 +205,10 @@ MssqlCrLayer.prototype.query = function(statement, params, options) {
200
205
  .then(function({recordset}) {
201
206
  return recordset ? recordset.map(fold) : []
202
207
  })
208
+ .catch(err => {
209
+ debug('%s %O', statement, err)
210
+ throw err
211
+ })
203
212
  })
204
213
  }
205
214
 
@@ -263,6 +272,7 @@ MssqlCrLayer.prototype.query = function(statement, params, options) {
263
272
  })
264
273
  })
265
274
  .catch(function(error) {
275
+ debug('%s %O', statement, error)
266
276
  return ps.unprepare().then(function() {
267
277
  throw error
268
278
  })