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

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 +6 -2
  2. package/package.json +1 -1
package/odbc.js CHANGED
@@ -95,7 +95,7 @@ module.exports = function(RED) {
95
95
  // Handle cases where the query is provided in the message
96
96
  if (msg?.query) {
97
97
  if (this.queryString) {
98
- node.log('Warning. The query defined in the node configuration was overwritten by msg.config.');
98
+ this.log('Warning. The query defined in the node configuration was overwritten by msg.config.');
99
99
  }
100
100
  this.queryString = msg.query;
101
101
  } else if (msg?.payload) {
@@ -212,7 +212,11 @@ module.exports = function(RED) {
212
212
  throw new Error("The query returned no results");
213
213
  }
214
214
  } catch (error) {
215
- // Handle query errors (e.g., log the error, set node status)
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
+
219
+ // Handle query errors
216
220
  this.status({ fill: "red", shape: "ring", text: "Query error" });
217
221
  throw error; // Re-throw to trigger the outer catch block
218
222
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bkmj/node-red-contrib-odbcmj",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "Node Red implementation of odbc.js",
5
5
  "keywords": [
6
6
  "node-red",