@bkmj/node-red-contrib-odbcmj 1.6.3 → 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.
- package/odbc.js +13 -2
- package/package.json +1 -1
package/odbc.js
CHANGED
|
@@ -212,16 +212,27 @@ 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
|
|
226
|
+
|
|
217
227
|
if(this?.queryString) error.query = this.queryString;
|
|
218
228
|
if(this?.parameters) error.params = msg.parameters;
|
|
229
|
+
|
|
219
230
|
if(error?.message){
|
|
220
|
-
error.message +=
|
|
231
|
+
error.message += str;
|
|
221
232
|
}
|
|
222
233
|
}
|
|
223
234
|
else if (typeof error == 'string'){
|
|
224
|
-
error +=
|
|
235
|
+
error += str;
|
|
225
236
|
}
|
|
226
237
|
// Handle query errors
|
|
227
238
|
this.status({ fill: "red", shape: "ring", text: "Query error" });
|