@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.
- package/odbc.js +11 -10
- 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 +=
|
|
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
|