@bkmj/node-red-contrib-odbcmj 1.6.1 → 1.6.3

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 -4
  2. package/package.json +1 -1
package/odbc.js CHANGED
@@ -212,10 +212,17 @@ module.exports = function(RED) {
212
212
  throw new Error("The query returned no results");
213
213
  }
214
214
  } catch (error) {
215
- // Enhance the error object with query information
216
- if(this?.queryString) error.query = this.queryString;
217
- if(this?.parameters) error.params = msg.parameters;
218
-
215
+ if(typeof error == 'object'){
216
+ // Enhance the error object with query information
217
+ if(this?.queryString) error.query = this.queryString;
218
+ if(this?.parameters) error.params = msg.parameters;
219
+ if(error?.message){
220
+ error.message += error?.query ? `\nquery: ${error.query}`: '' + error?.params ? `\nparams: ${error.params}` : ''
221
+ }
222
+ }
223
+ else if (typeof error == 'string'){
224
+ error += error?.query ? `\nquery: ${error.query}`: '' + error?.params ? `\nparams: ${error.params}` : ''
225
+ }
219
226
  // Handle query errors
220
227
  this.status({ fill: "red", shape: "ring", text: "Query error" });
221
228
  throw error; // Re-throw to trigger the outer catch block
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bkmj/node-red-contrib-odbcmj",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Node Red implementation of odbc.js",
5
5
  "keywords": [
6
6
  "node-red",