1
1
// Copyright (c) 2022, 2025, Oracle and/or its affiliates.
2
-
3
2
//-----------------------------------------------------------------------------
4
3
//
5
4
// This software is dual-licensed to you under the Universal Permissive License
@@ -204,6 +203,9 @@ const ERR_AZURE_VAULT_AUTH_FAILED = 527;
204
203
const ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED = 528 ;
205
204
const ERR_WALLET_TYPE_NOT_SUPPORTED = 529 ;
206
205
const ERR_HOST_NOT_FOUND = 530 ;
206
+ const ERR_ANO_PACKET = 531 ;
207
+ const ERR_ANO_STATUS = 532 ;
208
+ const ERR_ANO_NEGOTIATION = 533 ;
207
209
208
210
// Oracle SUCCESS_WITH_INFO warning start from 700
209
211
const WRN_COMPILATION_CREATE = 700 ;
@@ -540,23 +542,29 @@ messages.set(ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED, // NJS-522
540
542
'Azure Authentication Failed: The authentication parameter value %s may be incorrect' ) ;
541
543
messages . set ( ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG , // NJS-523
542
544
'Failed to retrieve configuration from Centralized Configuration Provider:\n %s' ) ;
543
- messages . set ( ERR_CONFIG_PROVIDER_NOT_SUPPORTED , // NJS-524
545
+ messages . set ( ERR_CONFIG_PROVIDER_NOT_SUPPORTED , // NJS-524
544
546
'Configuration Provider not supported: %s' ) ;
545
- messages . set ( ERR_CONFIG_PROVIDER_LOAD_FAILED , // NJS-525
547
+ messages . set ( ERR_CONFIG_PROVIDER_LOAD_FAILED , // NJS-525
546
548
'Centralized Config Provider failed to load required libraries. Please install the required libraries.\n %s' ) ;
547
- messages . set ( ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED , // NJS-526
549
+ messages . set ( ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED , // NJS-526
548
550
'OCI authentication failed: The authentication parameter value %s may be incorrect' ) ;
549
- messages . set ( ERR_AZURE_VAULT_AUTH_FAILED , // NJS-527
551
+ messages . set ( ERR_AZURE_VAULT_AUTH_FAILED , // NJS-527
550
552
'Azure Vault: Provide correct Azure Vault authentication details' ) ;
551
- messages . set ( ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED , // NJS-528
553
+ messages . set ( ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED , // NJS-528
552
554
'Azure service principal authentication requires either a client certificate path or a client secret string' ) ;
553
- messages . set ( ERR_WALLET_TYPE_NOT_SUPPORTED , // NJS-529
555
+ messages . set ( ERR_WALLET_TYPE_NOT_SUPPORTED , // NJS-529
554
556
'Invalid wallet content format. Supported format is PEM' ) ;
555
- messages . set ( ERR_HOST_NOT_FOUND , // NJS-530
557
+ messages . set ( ERR_HOST_NOT_FOUND , // NJS-530
556
558
'The host addresses or URLs provided by the connect string are incorrect or unresolvable in your network.' ) ;
559
+ messages . set ( ERR_ANO_PACKET , // NJS-531
560
+ 'Error in Advanced Networking Option packet received from the server' ) ;
561
+ messages . set ( ERR_ANO_STATUS , // NJS-532
562
+ '%s service recieved status failure' ) ;
563
+ messages . set ( ERR_ANO_NEGOTIATION , // NJS-533
564
+ 'Advanced Networking Option service negotiation failed. Native Network Encryption and DataIntegrity only supported in node-oracledb thick mode.\nCause: ORA-%s' ) ;
557
565
558
566
// Oracle SUCCESS_WITH_INFO warning
559
- messages . set ( WRN_COMPILATION_CREATE , // NJS-700
567
+ messages . set ( WRN_COMPILATION_CREATE , // NJS-700
560
568
'creation succeeded with compilation errors' ) ;
561
569
562
570
//-----------------------------------------------------------------------------
@@ -721,6 +729,14 @@ function throwErr() {
721
729
throw ( getErr ( ...arguments ) ) ;
722
730
}
723
731
732
+ function throwErrWithORAError ( ) {
733
+ const err = ( getErr ( ...arguments ) ) ;
734
+ const pos = err . message . indexOf ( "ORA-" ) ;
735
+ const oraError = err . message . substring ( pos + 4 , pos + 9 ) ;
736
+ err . message = err . message + '\nHelp: https://docs.oracle.com/error-help/db/ora-' + oraError ;
737
+ throw err ;
738
+ }
739
+
724
740
//-----------------------------------------------------------------------------
725
741
// throwNotImplemented()
726
742
//
@@ -730,6 +746,7 @@ function throwNotImplemented(feature) {
730
746
throwErr ( ERR_NOT_IMPLEMENTED , feature ) ;
731
747
}
732
748
749
+
733
750
//-----------------------------------------------------------------------------
734
751
// transformErr()
735
752
//
@@ -872,6 +889,9 @@ module.exports = {
872
889
ERR_CONFIG_PROVIDER_LOAD_FAILED ,
873
890
ERR_WALLET_TYPE_NOT_SUPPORTED ,
874
891
ERR_HOST_NOT_FOUND ,
892
+ ERR_ANO_PACKET ,
893
+ ERR_ANO_STATUS ,
894
+ ERR_ANO_NEGOTIATION ,
875
895
ERR_INVALID_BIND_NAME ,
876
896
ERR_WRONG_NUMBER_OF_BINDS ,
877
897
ERR_BUFFER_LENGTH_INSUFFICIENT ,
@@ -955,6 +975,7 @@ module.exports = {
955
975
assertPropValue,
956
976
getErr,
957
977
throwErr,
978
+ throwErrWithORAError,
958
979
throwNotImplemented,
959
980
transformErr
960
981
} ;
0 commit comments