This is an automated email from the ASF dual-hosted git repository.

sk0x50 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new c8685ff5b6 IGNITE-22269 Introduce new err code NULLABLE_VALUE_ERR 
(#3983)
c8685ff5b6 is described below

commit c8685ff5b6f5d3043bc09cb45a0de4cb2dcf9c3a
Author: Slava Koptilin <[email protected]>
AuthorDate: Tue Jun 25 18:39:52 2024 +0300

    IGNITE-22269 Introduce new err code NULLABLE_VALUE_ERR (#3983)
---
 modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java | 8 +++++++-
 .../java/org/apache/ignite/lang/UnexpectedNullValueException.java | 2 +-
 modules/platforms/cpp/ignite/common/error_codes.h                 | 3 ++-
 modules/platforms/cpp/ignite/odbc/common_types.cpp                | 1 +
 modules/platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs            | 5 ++++-
 5 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java 
b/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java
index 32cd1c7da7..1c549389c1 100755
--- a/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java
+++ b/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java
@@ -140,7 +140,13 @@ public class ErrorGroups {
         public static final int RESOURCE_CLOSING_ERR = 
COMMON_ERR_GROUP.registerErrorCode((short) 7);
 
         /** Can't marshal/unmarshal a user object. */
-        public static final int USER_OBJECT_SERIALIZATION_ERR = 
COMMON_ERR_GROUP.registerErrorCode((short) 9);
+        public static final int USER_OBJECT_SERIALIZATION_ERR = 
COMMON_ERR_GROUP.registerErrorCode((short) 8);
+
+        /**
+         * This error code indicates that a method can't return a {@code null} 
value due it's ambiguity
+         * (whether the value is absent or is {@code null}).
+         **/
+        public static final int NULLABLE_VALUE_ERR = 
COMMON_ERR_GROUP.registerErrorCode((short) 9);
 
         /**
          * This error code represents an internal error caused by faulty logic 
or coding in the Ignite codebase.
diff --git 
a/modules/api/src/main/java/org/apache/ignite/lang/UnexpectedNullValueException.java
 
b/modules/api/src/main/java/org/apache/ignite/lang/UnexpectedNullValueException.java
index 4caf9697b7..611509e777 100644
--- 
a/modules/api/src/main/java/org/apache/ignite/lang/UnexpectedNullValueException.java
+++ 
b/modules/api/src/main/java/org/apache/ignite/lang/UnexpectedNullValueException.java
@@ -31,7 +31,7 @@ public class UnexpectedNullValueException extends 
IgniteException {
      * @param msg Message.
      */
     public UnexpectedNullValueException(String msg) {
-        super(Common.INTERNAL_ERR, msg);
+        super(Common.NULLABLE_VALUE_ERR, msg);
     }
 
     /**
diff --git a/modules/platforms/cpp/ignite/common/error_codes.h 
b/modules/platforms/cpp/ignite/common/error_codes.h
old mode 100644
new mode 100755
index 535bddbe12..2485639437
--- a/modules/platforms/cpp/ignite/common/error_codes.h
+++ b/modules/platforms/cpp/ignite/common/error_codes.h
@@ -67,7 +67,8 @@ enum class code : underlying_t {
     NODE_LEFT = 0x10005,
     CURSOR_ALREADY_CLOSED = 0x10006,
     RESOURCE_CLOSING = 0x10007,
-    USER_OBJECT_SERIALIZATION = 0x10009,
+    USER_OBJECT_SERIALIZATION = 0x10008,
+    NULLABLE_VALUE = 0x10009,
     INTERNAL = 0x1ffff,
 
     // Table group. Group code: 2
diff --git a/modules/platforms/cpp/ignite/odbc/common_types.cpp 
b/modules/platforms/cpp/ignite/odbc/common_types.cpp
index 07f6d7e954..9df2feaf15 100644
--- a/modules/platforms/cpp/ignite/odbc/common_types.cpp
+++ b/modules/platforms/cpp/ignite/odbc/common_types.cpp
@@ -122,6 +122,7 @@ sql_state error_code_to_sql_state(error::code code) {
         case error::code::SSL_CONFIGURATION:
         case error::code::NODE_LEFT:
         case error::code::INTERNAL:
+        case error::code::NULLABLE_VALUE:
             return sql_state::SHY000_GENERAL_ERROR;
 
         // Table group. Group code: 2
diff --git a/modules/platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs 
b/modules/platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs
old mode 100644
new mode 100755
index 88f5352d17..338a2a71ba
--- a/modules/platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs
@@ -84,7 +84,10 @@ namespace Apache.Ignite
             public const int ResourceClosing = (GroupCode << 16) | (7 & 
0xFFFF);
 
             /// <summary> UserObjectSerialization error. </summary>
-            public const int UserObjectSerialization = (GroupCode << 16) | (9 
& 0xFFFF);
+            public const int UserObjectSerialization = (GroupCode << 16) | (8 
& 0xFFFF);
+
+            /// <summary> NullableValue error. </summary>
+            public const int NullableValue = (GroupCode << 16) | (9 & 0xFFFF);
 
             /// <summary> Internal error. </summary>
             public const int Internal = (GroupCode << 16) | (65535 & 0xFFFF);

Reply via email to