@@ -48,7 +48,7 @@ const errorMessages = {
48
48
'NJS-002' : 'NJS-002: invalid pool' ,
49
49
'NJS-004' : 'NJS-004: invalid value for property %s' ,
50
50
'NJS-005' : 'NJS-005: invalid value for parameter %d' ,
51
- 'NJS-009' : 'NJS-009: invalid number of parameters: %d passed but %d expected ' ,
51
+ 'NJS-009' : 'NJS-009: invalid number of parameters' ,
52
52
'NJS-037' : 'NJS-037: incompatible type of value provided' ,
53
53
'NJS-040' : 'NJS-040: connection request timeout. Request exceeded queueTimeout of %d' ,
54
54
'NJS-041' : 'NJS-041: cannot convert ResultSet to QueryStream after invoking methods' ,
@@ -61,7 +61,6 @@ const errorMessages = {
61
61
'NJS-065' : 'NJS-065: connection pool was closed' ,
62
62
'NJS-067' : 'NJS-067: a pre-built node-oracledb binary was not found for %s' ,
63
63
'NJS-069' : 'NJS-069: node-oracledb %s requires Node.js %s or later' ,
64
- 'NJS-076' : 'NJS-076: invalid number of parameters: %d passed but %d to %d expected' ,
65
64
} ;
66
65
67
66
// getInstallURL returns a string with installation URL
@@ -154,14 +153,8 @@ module.exports.assert = assert;
154
153
// optional parameters (range of number of parameters). If the number of
155
154
// arguments is not within the given range, an error is thrown.
156
155
function checkArgCount ( args , minArgCount , maxArgCount ) {
157
- if ( args . length < minArgCount || args . length > maxArgCount ) {
158
- if ( minArgCount == maxArgCount ) {
159
- throw new Error ( getErrorMessage ( 'NJS-009' , args . length , minArgCount ) ) ;
160
- } else {
161
- throw new Error ( getErrorMessage ( 'NJS-076' , args . length ,
162
- minArgCount , maxArgCount ) ) ;
163
- }
164
- }
156
+ if ( args . length < minArgCount || args . length > maxArgCount )
157
+ throw new Error ( getErrorMessage ( 'NJS-009' ) ) ;
165
158
}
166
159
167
160
module . exports . checkArgCount = checkArgCount ;
@@ -212,8 +205,7 @@ function promisify(oracledb, func) {
212
205
213
206
// Check for invalid number or type of parameter(s) as they should be
214
207
// eagerly thrown.
215
- if ( errorCode === 'NJS-009' || errorCode === 'NJS-005' ||
216
- errorCode === 'NJS-076' ) {
208
+ if ( errorCode === 'NJS-009' || errorCode === 'NJS-005' ) {
217
209
// Throwing the error outside of the promise wrapper so that its not
218
210
// swallowed up as a rejection.
219
211
process . nextTick ( function ( ) {
0 commit comments