Skip to content

Commit 91f582c

Browse files
committed
Improve error message when an object of the wrong type is bound
1 parent d76ceef commit 91f582c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/njsErrors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static const char *njsErrorMessages[] = {
5555
"NJS-041: cannot convert ResultSet to QueryStream after invoking methods", // errCannotConvertRsToStream
5656
"NJS-042: cannot invoke ResultSet methods after converting to QueryStream", // errCannotInvokeRsMethods
5757
"NJS-043: ResultSet already converted to QueryStream", // errResultSetAlreadyConverted
58-
"NJS-044: named JSON object is not expected in this context", // errNamedJSON
58+
"NJS-044: bind object must contain one of the following keys: \"dir\", \"type\", \"maxSize\", or \"val\"", // errNamedJSON
5959
"NJS-045: cannot load a node-oracledb binary for Node.js %s", // errCannotLoadBinary
6060
"NJS-046: pool alias \"%s\" already exists in the connection pool cache", // errPoolWithAliasAlreadyExists
6161
"NJS-047: pool alias \"%s\" not found in connection pool cache", // errPoolWithAliasNotFound

test/jsObjectGetter1.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,7 @@ describe('140. jsObjectGetter1.js', function() {
131131
[bindObj],
132132
function(err, result) {
133133
should.exist(err);
134-
should.strictEqual(
135-
err.message,
136-
"NJS-044: named JSON object is not expected in this context"
137-
);
134+
(err.message).should.startWith("NJS-044:");
138135
should.not.exist(result);
139136
done();
140137
}

0 commit comments

Comments
 (0)