@@ -387,9 +387,9 @@ void njsBaton::AsyncAfterWorkCallback(uv_work_t *req, int status)
387
387
void njsBaton::GetDPIError (void )
388
388
{
389
389
dpiContext_getError (njsOracledb::GetDPIContext (), &errorInfo);
390
- if (errorInfo.code == 1406 )
390
+ if (errorInfo.code == 1406 ) {
391
391
error = njsMessages::Get (errInsufficientBufferForBinds);
392
- else {
392
+ } else {
393
393
error = std::string (errorInfo.message , errorInfo.messageLength );
394
394
dpiError = true ;
395
395
}
@@ -404,9 +404,11 @@ void njsBaton::GetDPIError(void)
404
404
// -----------------------------------------------------------------------------
405
405
void njsBaton::SetDPIConnHandle (dpiConn *handle)
406
406
{
407
- if (dpiConn_addRef (handle) < 0 )
407
+ if (dpiConn_addRef (handle) < 0 ) {
408
408
GetDPIError ();
409
- else dpiConnHandle = handle;
409
+ } else {
410
+ dpiConnHandle = handle;
411
+ }
410
412
}
411
413
412
414
@@ -417,9 +419,11 @@ void njsBaton::SetDPIConnHandle(dpiConn *handle)
417
419
// -----------------------------------------------------------------------------
418
420
void njsBaton::SetDPIPoolHandle (dpiPool *handle)
419
421
{
420
- if (dpiPool_addRef (handle) < 0 )
422
+ if (dpiPool_addRef (handle) < 0 ) {
421
423
GetDPIError ();
422
- else dpiPoolHandle = handle;
424
+ } else {
425
+ dpiPoolHandle = handle;
426
+ }
423
427
}
424
428
425
429
@@ -430,9 +434,11 @@ void njsBaton::SetDPIPoolHandle(dpiPool *handle)
430
434
// -----------------------------------------------------------------------------
431
435
void njsBaton::SetDPIStmtHandle (dpiStmt *handle)
432
436
{
433
- if (dpiStmt_addRef (handle) < 0 )
437
+ if (dpiStmt_addRef (handle) < 0 ) {
434
438
GetDPIError ();
435
- else dpiStmtHandle = handle;
439
+ } else {
440
+ dpiStmtHandle = handle;
441
+ }
436
442
}
437
443
438
444
@@ -443,9 +449,11 @@ void njsBaton::SetDPIStmtHandle(dpiStmt *handle)
443
449
// -----------------------------------------------------------------------------
444
450
void njsBaton::SetDPILobHandle (dpiLob *handle)
445
451
{
446
- if (dpiLob_addRef (handle) < 0 )
452
+ if (dpiLob_addRef (handle) < 0 ) {
447
453
GetDPIError ();
448
- else dpiLobHandle = handle;
454
+ } else {
455
+ dpiLobHandle = handle;
456
+ }
449
457
}
450
458
451
459
@@ -456,9 +464,11 @@ void njsBaton::SetDPILobHandle(dpiLob *handle)
456
464
// -----------------------------------------------------------------------------
457
465
void njsBaton::SetDPISubscrHandle (dpiSubscr *handle)
458
466
{
459
- if (dpiSubscr_addRef (handle) < 0 )
467
+ if (dpiSubscr_addRef (handle) < 0 ) {
460
468
GetDPIError ();
461
- else dpiSubscrHandle = handle;
469
+ } else {
470
+ dpiSubscrHandle = handle;
471
+ }
462
472
}
463
473
464
474
@@ -486,13 +496,10 @@ bool njsBaton::GetBoolFromJSON(Local<Object> obj, const char *key, int index,
486
496
/* Undefined implies value not provided or equivalent */
487
497
if (!jsValue->IsUndefined ()) {
488
498
if (jsValue->IsBoolean ()) {
489
- // Get the boolean value
490
499
*value = jsValue->ToBoolean ()->Value ();
491
- }
492
- else {
493
- // Non-Boolean value provided, report error
494
- error = njsMessages::Get ( errInvalidPropertyValueInParam, key,
495
- index + 1 ) ;
500
+ } else {
501
+ error = njsMessages::Get (errInvalidPropertyValueInParam, key,
502
+ index + 1 );
496
503
return false ;
497
504
}
498
505
}
0 commit comments