Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 8028713

Browse files
committed
handle sql exceptions
1 parent 21a0767 commit 8028713

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

initializers/dataAccess.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ function executePreparedStatement(api, sql, parameters, connection, next, db) {
117117
async.waterfall([
118118
function (cb) {
119119
parameterizeQuery(sql, parameters, cb);
120-
},
121-
function (parametrizedQuery, cb) {
120+
}, function (parametrizedQuery, cb) {
122121
sql = parametrizedQuery;
123122

124123
if (api.helper.readTransaction) {
@@ -142,6 +141,10 @@ function executePreparedStatement(api, sql, parameters, connection, next, db) {
142141
return cb(JSON.stringify(body));
143142
}
144143

144+
if (body.exception) {
145+
return cb("SQL Exception from Java Bridge: " + body.exception);
146+
}
147+
145148
api.log("Response:" + JSON.stringify(body), "debug");
146149
return cb(null, body.results);
147150
});

0 commit comments

Comments
 (0)