@bkmj/node-red-contrib-odbcmj 1.6.4 → 1.6.6
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 +12 -10
- package/package.json +1 -1
package/odbc.js
CHANGED
|
@@ -212,25 +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
|
+
return str;
|
|
223
|
+
}
|
|
224
|
+
})()
|
|
215
225
|
if(typeof error == 'object'){
|
|
216
226
|
// Enhance the error object with query information
|
|
217
227
|
|
|
218
228
|
if(this?.queryString) error.query = this.queryString;
|
|
219
229
|
if(this?.parameters) error.params = msg.parameters;
|
|
230
|
+
|
|
220
231
|
if(error?.message){
|
|
221
|
-
error.message +=
|
|
232
|
+
error.message += str;
|
|
222
233
|
}
|
|
223
234
|
}
|
|
224
235
|
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
236
|
error += str;
|
|
235
237
|
}
|
|
236
238
|
// Handle query errors
|