File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -146,10 +146,10 @@ function getConnection(getConnectionCb) {
146
146
// (which is a C layer getter) an error will be thrown.
147
147
if ( ! self . _isValid ) {
148
148
if ( getConnectionCb && typeof getConnectionCb === 'function' ) {
149
- getConnectionCb ( new Error ( 'NJS-002: invalid pool' ) ) ;
149
+ getConnectionCb ( new Error ( nodbUtil . getErrorMessage ( 'NJS-002' ) ) ) ;
150
150
return ;
151
151
} else {
152
- throw new Error ( 'NJS-002: invalid pool' ) ;
152
+ throw new Error ( nodbUtil . getErrorMessage ( 'NJS-002' ) ) ;
153
153
}
154
154
}
155
155
@@ -236,8 +236,7 @@ function logStats() {
236
236
var averageTimeInQueue ;
237
237
238
238
if ( ! self . _isValid ) {
239
- console . log ( '_logStats must be called prior to terminating pool.' ) ;
240
- return ;
239
+ throw new Error ( nodbUtil . getErrorMessage ( 'NJS-002' ) ) ;
241
240
}
242
241
243
242
if ( self . _enableStats !== true ) {
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ var util = require('util');
22
22
// errorMessages is a temporary duplication of error messages defined in the C
23
23
// layer that will be removed once a function to fetch from the C layer is added.
24
24
var errorMessages = {
25
+ 'NJS-002' : 'NJS-002: invalid pool' ,
25
26
'NJS-005' : 'NJS-005: invalid value for parameter %d' ,
26
27
'NJS-006' : 'NJS-006: invalid type for parameter %d' ,
27
28
'NJS-009' : 'NJS-009: invalid number of parameters' ,
You can’t perform that action at this time.
0 commit comments