@bkmj/node-red-contrib-odbcmj 1.6.4 → 1.6.5

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/odbc.js +11 -10
  2. package/package.json +1 -1
package/odbc.js CHANGED
@@ -212,25 +212,26 @@ module.exports = function(RED) {
212
212
  throw new Error("The query returned no results");
213
213
  }
214
214
  } catch (error) {
215
+ const str = (() =>{
216
+ let str = ''
217
+ if(this?.queryString || this?.parameters){
218
+ str += " {"
219
+ if(this?.queryString) str += `"query":'${this.queryString}'`;
220
+ if(msg?.parameters) str += `, "params":'${msg.parameters}'`;
221
+ str += "}"
222
+ }
223
+ })()
215
224
  if(typeof error == 'object'){
216
225
  // Enhance the error object with query information
217
226
 
218
227
  if(this?.queryString) error.query = this.queryString;
219
228
  if(this?.parameters) error.params = msg.parameters;
229
+
220
230
  if(error?.message){
221
- error.message += error?.query ? `\nquery: ${error.query}`: '' + error?.params ? `\nparams: ${error.params}` : ''
231
+ error.message += str;
222
232
  }
223
233
  }
224
234
  else if (typeof error == 'string'){
225
- const str = (() =>{
226
- let str = ''
227
- if(this?.queryString || this?.parameters){
228
- str += " {"
229
- if(this?.queryString) str += `"query":'${error.query}'`;
230
- if(this?.parameters) str += `, "query":'${error.params}'`;
231
- str += "}"
232
- }
233
- })()
234
235
  error += str;
235
236
  }
236
237
  // Handle query errors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bkmj/node-red-contrib-odbcmj",
3
- "version": "1.6.4",
3
+ "version": "1.6.5",
4
4
  "description": "Node Red implementation of odbc.js",
5
5
  "keywords": [
6
6
  "node-red",