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 69073325b9 IGNITE-19533 Renamed UNKNOWN_ERR error code to INTERNAL_ERR. Removed UNEXPECTED_ERR error code. (#2097) 69073325b9 is described below commit 69073325b905238f33e7b1b4a0f4c3160246597f Author: Slava Koptilin <slava.kopti...@gmail.com> AuthorDate: Wed May 24 18:35:24 2023 +0300 IGNITE-19533 Renamed UNKNOWN_ERR error code to INTERNAL_ERR. Removed UNEXPECTED_ERR error code. (#2097) --- docs/_docs/handling-exceptions.adoc | 6 +- .../org/apache/ignite/lang/IgniteException.java | 14 ++--- .../internal/catalog/CatalogServiceImpl.java | 2 +- .../internal/catalog/storage/UpdateLogImpl.java | 2 +- .../ignite/client/handler/ItClientHandlerTest.java | 6 +- .../handler/ClientInboundMessageHandler.java | 4 +- .../internal/client/table/ClientKeyValueView.java | 6 +- .../client/table/ClientRecordSerializer.java | 10 ++-- .../ignite/internal/client/table/ClientTable.java | 4 +- .../internal/client/tx/ClientTransaction.java | 4 +- .../java/org/apache/ignite/lang/ErrorGroups.java | 68 +++++++--------------- .../lang/IgniteInternalCheckedException.java | 12 ++-- .../ignite/lang/IgniteInternalException.java | 10 ++-- .../org/apache/ignite/lang/ErrorGroupTest.java | 8 +-- .../apache/ignite/internal/index/IndexManager.java | 2 +- .../raft/client/TopologyAwareRaftGroupService.java | 2 +- .../handler/IgniteExceptionHandlerTest.java | 12 ++-- .../apache/ignite/internal/rest/RestComponent.java | 4 +- .../authentication/NodeOnlyEndpointsFilter.java | 2 +- .../runner/app/client/ItThinClientComputeTest.java | 6 +- .../internal/component/RestAddressReporter.java | 4 +- .../ignite/internal/schema/NativeTypeSpec.java | 2 +- .../ignite/internal/sql/api/SessionImpl.java | 4 +- .../sql/engine/exec/ExchangeServiceImpl.java | 8 +-- .../internal/sql/engine/exec/ExecutionContext.java | 6 +- .../sql/engine/exec/ExecutionServiceImpl.java | 4 +- .../ignite/internal/sql/engine/exec/rel/Inbox.java | 4 +- .../internal/sql/engine/exec/rel/Outbox.java | 6 +- .../internal/sql/engine/exec/rel/RootNode.java | 4 +- .../internal/sql/engine/trait/TraitUtils.java | 2 +- .../sql/engine/exec/ExecutionServiceImplTest.java | 4 +- .../distributed/storage/InternalTableImpl.java | 4 +- 32 files changed, 105 insertions(+), 131 deletions(-) diff --git a/docs/_docs/handling-exceptions.adoc b/docs/_docs/handling-exceptions.adoc index 0ce9d421cb..f3924a4b6c 100644 --- a/docs/_docs/handling-exceptions.adoc +++ b/docs/_docs/handling-exceptions.adoc @@ -26,9 +26,9 @@ When the exception happens, Apache Ignite 3 provides a UUID of the specific exce [cols="20%,80%", width="100%"] |=== |Exception |Description -|`IGN-CMN-1`|Unexpected error occurred. -|`IGN-CMN-2`|Operation was stopped because node is stopping. -|`IGN-CMN-3`|Required component was not started. +|`IGN-CMN-1`|Operation was stopped because node is stopping. +|`IGN-CMN-2`|Required component was not started. +|`IGN-CMN-65535`|Internal error. |=== == Table Exceptions diff --git a/modules/api/src/main/java/org/apache/ignite/lang/IgniteException.java b/modules/api/src/main/java/org/apache/ignite/lang/IgniteException.java index cae19502f1..3c8bc331b3 100644 --- a/modules/api/src/main/java/org/apache/ignite/lang/IgniteException.java +++ b/modules/api/src/main/java/org/apache/ignite/lang/IgniteException.java @@ -23,7 +23,7 @@ import static org.apache.ignite.lang.ErrorGroup.errorMessage; import static org.apache.ignite.lang.ErrorGroup.errorMessageFromCause; import static org.apache.ignite.lang.ErrorGroup.extractErrorCode; import static org.apache.ignite.lang.ErrorGroup.extractGroupCode; -import static org.apache.ignite.lang.ErrorGroups.Common.UNKNOWN_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import java.lang.reflect.Constructor; import java.util.Objects; @@ -60,7 +60,7 @@ public class IgniteException extends RuntimeException { */ @Deprecated public IgniteException() { - this(UNKNOWN_ERR); + this(INTERNAL_ERR); } /** @@ -70,7 +70,7 @@ public class IgniteException extends RuntimeException { */ @Deprecated public IgniteException(String msg) { - this(UNKNOWN_ERR, msg); + this(INTERNAL_ERR, msg); } /** @@ -80,7 +80,7 @@ public class IgniteException extends RuntimeException { */ @Deprecated public IgniteException(Throwable cause) { - this(UNKNOWN_ERR, cause); + this(INTERNAL_ERR, cause); } /** @@ -91,7 +91,7 @@ public class IgniteException extends RuntimeException { */ @Deprecated public IgniteException(String msg, @Nullable Throwable cause) { - this(UNKNOWN_ERR, msg, cause); + this(INTERNAL_ERR, msg, cause); } /** @@ -285,7 +285,7 @@ public class IgniteException extends RuntimeException { return new IgniteException(iex.traceId(), iex.code(), e.getMessage(), e); } - return new IgniteException(UNKNOWN_ERR, e.getMessage(), e); + return new IgniteException(INTERNAL_ERR, e.getMessage(), e); } /** @@ -295,6 +295,6 @@ public class IgniteException extends RuntimeException { * @return Ignite error code or UNKNOWN_ERR. */ public static int getIgniteErrorCode(Throwable t) { - return (t instanceof IgniteException) ? ((IgniteException) t).code() : UNKNOWN_ERR; + return (t instanceof IgniteException) ? ((IgniteException) t).code() : INTERNAL_ERR; } } diff --git a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogServiceImpl.java b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogServiceImpl.java index 4920647d4a..027a74484c 100644 --- a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogServiceImpl.java +++ b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogServiceImpl.java @@ -225,7 +225,7 @@ public class CatalogServiceImpl extends Producer<CatalogEvent, CatalogEventParam private CompletableFuture<Void> saveUpdate(UpdateProducer updateProducer, int attemptNo) { if (attemptNo >= MAX_RETRY_COUNT) { - return failedFuture(new IgniteInternalException(Common.UNEXPECTED_ERR, "Max retry limit exceeded: " + attemptNo)); + return failedFuture(new IgniteInternalException(Common.INTERNAL_ERR, "Max retry limit exceeded: " + attemptNo)); } Catalog catalog = catalogByVer.lastEntry().getValue(); diff --git a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/UpdateLogImpl.java b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/UpdateLogImpl.java index acd1278148..12c5bb04a1 100644 --- a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/UpdateLogImpl.java +++ b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/UpdateLogImpl.java @@ -87,7 +87,7 @@ public class UpdateLogImpl implements UpdateLog { if (handler == null) { throw new IgniteInternalException( - Common.UNEXPECTED_ERR, + Common.INTERNAL_ERR, "Handler must be registered prior to component start" ); } diff --git a/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/ItClientHandlerTest.java b/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/ItClientHandlerTest.java index 92c2d81402..dc2de84d7d 100644 --- a/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/ItClientHandlerTest.java +++ b/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/ItClientHandlerTest.java @@ -20,7 +20,7 @@ package org.apache.ignite.client.handler; import static org.apache.ignite.client.handler.ItClientHandlerTestUtils.MAGIC; import static org.apache.ignite.lang.ErrorGroups.Authentication.COMMON_AUTHENTICATION_ERR; import static org.apache.ignite.lang.ErrorGroups.Client.PROTOCOL_COMPATIBILITY_ERR; -import static org.apache.ignite.lang.ErrorGroups.Common.UNKNOWN_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.junit.jupiter.api.Assertions.assertArrayEquals; @@ -248,7 +248,7 @@ public class ItClientHandlerTest { final var patch = unpacker.unpackInt(); unpacker.skipValue(); // traceId - final var code = unpacker.tryUnpackNil() ? UNKNOWN_ERR : unpacker.unpackInt(); + final var code = unpacker.tryUnpackNil() ? INTERNAL_ERR : unpacker.unpackInt(); final var errClassName = unpacker.unpackString(); final var errMsg = unpacker.tryUnpackNil() ? null : unpacker.unpackString(); final var errStackTrace = unpacker.tryUnpackNil() ? null : unpacker.unpackString(); @@ -301,7 +301,7 @@ public class ItClientHandlerTest { final var patch = unpacker.unpackInt(); unpacker.skipValue(); // traceId - final var code = unpacker.tryUnpackNil() ? UNKNOWN_ERR : unpacker.unpackInt(); + final var code = unpacker.tryUnpackNil() ? INTERNAL_ERR : unpacker.unpackInt(); final var errClassName = unpacker.unpackString(); final var errMsg = unpacker.tryUnpackNil() ? null : unpacker.unpackString(); final var errStackTrace = unpacker.tryUnpackNil() ? null : unpacker.unpackString(); diff --git a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java index 4e3ca7ec16..2e45d1ab85 100644 --- a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java +++ b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java @@ -20,7 +20,7 @@ package org.apache.ignite.client.handler; import static org.apache.ignite.lang.ErrorGroups.Client.HANDSHAKE_HEADER_ERR; import static org.apache.ignite.lang.ErrorGroups.Client.PROTOCOL_COMPATIBILITY_ERR; import static org.apache.ignite.lang.ErrorGroups.Client.PROTOCOL_ERR; -import static org.apache.ignite.lang.ErrorGroups.Common.UNEXPECTED_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; @@ -395,7 +395,7 @@ public class ClientInboundMessageHandler extends ChannelInboundHandlerAdapter im packer.packInt(iex.code()); } else { packer.packUuid(UUID.randomUUID()); - packer.packInt(UNEXPECTED_ERR); + packer.packInt(INTERNAL_ERR); } packer.packString(err.getClass().getName()); diff --git a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueView.java b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueView.java index 317f639d98..4751ea6237 100644 --- a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueView.java +++ b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientKeyValueView.java @@ -19,7 +19,7 @@ package org.apache.ignite.internal.client.table; import static org.apache.ignite.internal.client.ClientUtils.sync; import static org.apache.ignite.internal.client.table.ClientTable.writeTx; -import static org.apache.ignite.lang.ErrorGroups.Common.UNKNOWN_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import java.util.BitSet; import java.util.Collection; @@ -438,7 +438,7 @@ public class ClientKeyValueView<K, V> implements KeyValueView<K, V> { s.getMarshaller(keySer.mapper(), TuplePart.KEY).writeObject(key, writer); s.getMarshaller(valSer.mapper(), TuplePart.VAL).writeObject(val, writer); } catch (MarshallerException e) { - throw new IgniteException(UNKNOWN_ERR, e.getMessage(), e); + throw new IgniteException(INTERNAL_ERR, e.getMessage(), e); } w.out().packBinaryTuple(builder, noValueSet); @@ -469,7 +469,7 @@ public class ClientKeyValueView<K, V> implements KeyValueView<K, V> { return res; } catch (MarshallerException e) { - throw new IgniteException(UNKNOWN_ERR, e.getMessage(), e); + throw new IgniteException(INTERNAL_ERR, e.getMessage(), e); } } } diff --git a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordSerializer.java b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordSerializer.java index 63c66f348e..dd5703410d 100644 --- a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordSerializer.java +++ b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordSerializer.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.client.table; import static org.apache.ignite.internal.client.table.ClientTable.writeTx; -import static org.apache.ignite.lang.ErrorGroups.Common.UNKNOWN_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import java.util.ArrayList; import java.util.BitSet; @@ -113,7 +113,7 @@ public class ClientRecordSerializer<R> { out.packBinaryTuple(builder, noValueSet); } catch (MarshallerException e) { - throw new IgniteException(UNKNOWN_ERR, e.getMessage(), e); + throw new IgniteException(INTERNAL_ERR, e.getMessage(), e); } } @@ -190,7 +190,7 @@ public class ClientRecordSerializer<R> { } } } catch (MarshallerException e) { - throw new IgniteException(UNKNOWN_ERR, e.getMessage(), e); + throw new IgniteException(INTERNAL_ERR, e.getMessage(), e); } return res; @@ -208,7 +208,7 @@ public class ClientRecordSerializer<R> { try { return (R) marshaller.readObject(reader, null); } catch (MarshallerException e) { - throw new IgniteException(UNKNOWN_ERR, e.getMessage(), e); + throw new IgniteException(INTERNAL_ERR, e.getMessage(), e); } } @@ -225,7 +225,7 @@ public class ClientRecordSerializer<R> { try { return (R) valMarshaller.readObject(reader, null); } catch (MarshallerException e) { - throw new IgniteException(UNKNOWN_ERR, e.getMessage(), e); + throw new IgniteException(INTERNAL_ERR, e.getMessage(), e); } } diff --git a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientTable.java b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientTable.java index bf0615bb02..d6b837b5ce 100644 --- a/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientTable.java +++ b/modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientTable.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.client.table; import static org.apache.ignite.lang.ErrorGroups.Client.CONNECTION_ERR; -import static org.apache.ignite.lang.ErrorGroups.Common.UNEXPECTED_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import java.util.ArrayList; import java.util.List; @@ -173,7 +173,7 @@ public class ClientTable implements Table { if (schemaCnt == 0) { log.warn("Schema not found [tableId=" + id + ", schemaVersion=" + ver + "]"); - throw new IgniteException(UNEXPECTED_ERR, "Schema not found: " + ver); + throw new IgniteException(INTERNAL_ERR, "Schema not found: " + ver); } ClientSchema last = null; diff --git a/modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java b/modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java index d82521e62c..7e91cd0ccb 100644 --- a/modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java +++ b/modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.client.tx; import static org.apache.ignite.internal.client.ClientUtils.sync; -import static org.apache.ignite.lang.ErrorGroups.Common.UNEXPECTED_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicReference; @@ -130,7 +130,7 @@ public class ClientTransaction implements Transaction { */ public static ClientTransaction get(@NotNull Transaction tx) { if (!(tx instanceof ClientTransaction)) { - throw new IgniteException(UNEXPECTED_ERR, "Unsupported transaction implementation: '" + throw new IgniteException(INTERNAL_ERR, "Unsupported transaction implementation: '" + tx.getClass() + "'. Use IgniteClient.transactions() to start transactions."); } diff --git a/modules/core/src/main/java/org/apache/ignite/lang/ErrorGroups.java b/modules/core/src/main/java/org/apache/ignite/lang/ErrorGroups.java index ccefdc3cd2..32fb3285e9 100755 --- a/modules/core/src/main/java/org/apache/ignite/lang/ErrorGroups.java +++ b/modules/core/src/main/java/org/apache/ignite/lang/ErrorGroups.java @@ -24,27 +24,26 @@ package org.apache.ignite.lang; public class ErrorGroups { /** Common error group. */ public static class Common { - /** Unknown error group. */ + /** Common error group. */ public static final ErrorGroup COMMON_ERR_GROUP = ErrorGroup.newGroup("CMN", 1); - /** Unexpected error. */ - public static final int UNEXPECTED_ERR = COMMON_ERR_GROUP.registerErrorCode(1); - /** Node stopping error. */ - public static final int NODE_STOPPING_ERR = COMMON_ERR_GROUP.registerErrorCode(2); + public static final int NODE_STOPPING_ERR = COMMON_ERR_GROUP.registerErrorCode(1); /** Component not started error. */ - public static final int COMPONENT_NOT_STARTED_ERR = COMMON_ERR_GROUP.registerErrorCode(3); + public static final int COMPONENT_NOT_STARTED_ERR = COMMON_ERR_GROUP.registerErrorCode(2); /** Illegal argument or argument in a wrong format has been passed. */ - public static final int ILLEGAL_ARGUMENT_ERR = COMMON_ERR_GROUP.registerErrorCode(4); + public static final int ILLEGAL_ARGUMENT_ERR = COMMON_ERR_GROUP.registerErrorCode(3); /** SSL can not be configured error. */ - public static final int SSL_CONFIGURATION_ERR = COMMON_ERR_GROUP.registerErrorCode(5); + public static final int SSL_CONFIGURATION_ERR = COMMON_ERR_GROUP.registerErrorCode(4); - /** Unknown error. */ - @Deprecated - public static final int UNKNOWN_ERR = COMMON_ERR_GROUP.registerErrorCode(0xFFFF); + /** + * This error code represents an internal error caused by faulty logic or coding in the Ignite codebase. + * In general, this error code should be considered as a non-recoverable error + */ + public static final int INTERNAL_ERR = COMMON_ERR_GROUP.registerErrorCode(0xFFFF); } /** Tables error group. */ @@ -201,9 +200,6 @@ public class ErrorGroups { /** Execution cancelled. */ public static final int EXECUTION_CANCELLED_ERR = SQL_ERR_GROUP.registerErrorCode(33); - - /** Error code describing any unexpected situation. */ - public static final int INTERNAL_ERR = SQL_ERR_GROUP.registerErrorCode(34); } /** Meta storage error group. */ @@ -354,58 +350,36 @@ public class ErrorGroups { public static final int UNRESOLVABLE_CONSISTENT_ID_ERR = NETWORK_ERR_GROUP.registerErrorCode(1); } - /** - * Node configuration error group. - */ + /** Node configuration error group. */ public static class NodeConfiguration { - /** - * Node configuration error group. - */ + /** Node configuration error group. */ public static final ErrorGroup NODE_CONFIGURATION_ERR_GROUP = ErrorGroup.newGroup("NODECFG", 12); - /** - * Config read error. - */ + /** Config read error. */ public static final int CONFIG_READ_ERR = NODE_CONFIGURATION_ERR_GROUP.registerErrorCode(1); - /** - * Config file creation error. - */ + /** Config file creation error. */ public static final int CONFIG_FILE_CREATE_ERR = NODE_CONFIGURATION_ERR_GROUP.registerErrorCode(2); - /** - * Config write error. - */ + /** Config write error. */ public static final int CONFIG_WRITE_ERR = NODE_CONFIGURATION_ERR_GROUP.registerErrorCode(3); - /** - * Config parse error. - */ + /** Config parse error. */ public static final int CONFIG_PARSE_ERR = NODE_CONFIGURATION_ERR_GROUP.registerErrorCode(4); } - /** - * Code deployment error group. - */ + /** Code deployment error group. */ public static class CodeDeployment { - /** - * Code deployment error group. - */ + /** Code deployment error group. */ public static final ErrorGroup CODE_DEPLOYMENT_ERR_GROUP = ErrorGroup.newGroup("CODEDEPLOY", 13); - /** - * Access to non-existing deployment unit. - */ + /** Access to non-existing deployment unit. */ public static final int UNIT_NOT_FOUND_ERR = CODE_DEPLOYMENT_ERR_GROUP.registerErrorCode(1); - /** - * Unit duplicate error. - */ + /** Unit duplicate error. */ public static final int UNIT_ALREADY_EXISTS_ERR = CODE_DEPLOYMENT_ERR_GROUP.registerErrorCode(2); - /** - * Deployment unit content read error. - */ + /** Deployment unit content read error. */ public static final int UNIT_CONTENT_READ_ERR = CODE_DEPLOYMENT_ERR_GROUP.registerErrorCode(3); } diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteInternalCheckedException.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteInternalCheckedException.java index b5660ab067..52733b294f 100644 --- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteInternalCheckedException.java +++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteInternalCheckedException.java @@ -23,7 +23,7 @@ import static org.apache.ignite.lang.ErrorGroup.errorMessage; import static org.apache.ignite.lang.ErrorGroup.errorMessageFromCause; import static org.apache.ignite.lang.ErrorGroup.extractErrorCode; import static org.apache.ignite.lang.ErrorGroup.extractGroupCode; -import static org.apache.ignite.lang.ErrorGroups.Common.UNKNOWN_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import java.util.UUID; import org.jetbrains.annotations.Nullable; @@ -180,7 +180,7 @@ public class IgniteInternalCheckedException extends Exception { */ @Deprecated public IgniteInternalCheckedException() { - this(UNKNOWN_ERR); + this(INTERNAL_ERR); } /** @@ -190,7 +190,7 @@ public class IgniteInternalCheckedException extends Exception { */ @Deprecated public IgniteInternalCheckedException(String msg) { - this(UNKNOWN_ERR, msg); + this(INTERNAL_ERR, msg); } /** @@ -200,7 +200,7 @@ public class IgniteInternalCheckedException extends Exception { */ @Deprecated public IgniteInternalCheckedException(Throwable cause) { - this(UNKNOWN_ERR, cause); + this(INTERNAL_ERR, cause); } /** @@ -212,7 +212,7 @@ public class IgniteInternalCheckedException extends Exception { */ @Deprecated public IgniteInternalCheckedException(String msg, @Nullable Throwable cause, boolean writableStackTrace) { - this(UUID.randomUUID(), UNKNOWN_ERR, msg, cause, writableStackTrace); + this(UUID.randomUUID(), INTERNAL_ERR, msg, cause, writableStackTrace); } /** @@ -223,7 +223,7 @@ public class IgniteInternalCheckedException extends Exception { */ @Deprecated public IgniteInternalCheckedException(String msg, @Nullable Throwable cause) { - this(UNKNOWN_ERR, msg, cause); + this(INTERNAL_ERR, msg, cause); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteInternalException.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteInternalException.java index 6d766db7da..fb10cdbbbe 100644 --- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteInternalException.java +++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteInternalException.java @@ -23,7 +23,7 @@ import static org.apache.ignite.lang.ErrorGroup.errorMessage; import static org.apache.ignite.lang.ErrorGroup.errorMessageFromCause; import static org.apache.ignite.lang.ErrorGroup.extractErrorCode; import static org.apache.ignite.lang.ErrorGroup.extractGroupCode; -import static org.apache.ignite.lang.ErrorGroups.Common.UNKNOWN_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import java.util.UUID; import org.jetbrains.annotations.Nullable; @@ -157,7 +157,7 @@ public class IgniteInternalException extends RuntimeException { */ @Deprecated public IgniteInternalException() { - this(UNKNOWN_ERR); + this(INTERNAL_ERR); } /** @@ -167,7 +167,7 @@ public class IgniteInternalException extends RuntimeException { */ @Deprecated public IgniteInternalException(String msg) { - this(UNKNOWN_ERR, msg); + this(INTERNAL_ERR, msg); } /** @@ -177,7 +177,7 @@ public class IgniteInternalException extends RuntimeException { */ @Deprecated public IgniteInternalException(Throwable cause) { - this(UNKNOWN_ERR, cause); + this(INTERNAL_ERR, cause); } /** @@ -188,7 +188,7 @@ public class IgniteInternalException extends RuntimeException { */ @Deprecated public IgniteInternalException(String msg, @Nullable Throwable cause) { - this(UNKNOWN_ERR, msg, cause); + this(INTERNAL_ERR, msg, cause); } /** diff --git a/modules/core/src/test/java/org/apache/ignite/lang/ErrorGroupTest.java b/modules/core/src/test/java/org/apache/ignite/lang/ErrorGroupTest.java index 2dd029a9f6..a1c8bb61b2 100644 --- a/modules/core/src/test/java/org/apache/ignite/lang/ErrorGroupTest.java +++ b/modules/core/src/test/java/org/apache/ignite/lang/ErrorGroupTest.java @@ -57,21 +57,21 @@ class ErrorGroupTest { void createsErrorMassage() { // Given UUID traceId = UUID.fromString("24103638-d079-4a19-a8f6-ca9c23662908"); - int code = Common.UNEXPECTED_ERR; + int code = Common.INTERNAL_ERR; String reason = "I'm the reason"; // When String errorMessage = ErrorGroup.errorMessage(traceId, code, reason); // Then - assertThat(errorMessage, equalTo("IGN-CMN-1 TraceId:24103638-d079-4a19-a8f6-ca9c23662908 I'm the reason")); + assertThat(errorMessage, equalTo("IGN-CMN-65535 TraceId:24103638-d079-4a19-a8f6-ca9c23662908 I'm the reason")); } @Test void doesNotDuplicateErrorCodeAndTraceId() { // Given UUID traceId = UUID.fromString("24103638-d079-4a19-a8f6-ca9c23662908"); - int code = Common.UNEXPECTED_ERR; + int code = Common.INTERNAL_ERR; IgniteInternalException cause = new IgniteInternalException(traceId, code, "I'm the\n reason\n"); IgniteInternalException origin = new IgniteInternalException(traceId, code, cause); @@ -79,7 +79,7 @@ class ErrorGroupTest { String errorMessage = origin.getMessage(); // Then error code and traceId are not duplicated - assertThat(errorMessage, equalTo("IGN-CMN-1 TraceId:24103638-d079-4a19-a8f6-ca9c23662908 I'm the\n reason\n")); + assertThat(errorMessage, equalTo("IGN-CMN-65535 TraceId:24103638-d079-4a19-a8f6-ca9c23662908 I'm the\n reason\n")); } @SuppressWarnings({"rawtypes", "OptionalGetWithoutIsPresent"}) diff --git a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java index f17c37faa2..8e5e2cb81f 100644 --- a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java +++ b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java @@ -243,7 +243,7 @@ public class IndexManager extends Producer<IndexEvent, IndexEventParameters> imp future.complete(true); } else { var exception = new IgniteInternalException( - Common.UNEXPECTED_ERR, "Looks like the index was concurrently deleted"); + Common.INTERNAL_ERR, "Looks like the index was concurrently deleted"); LOG.info("Unable to create index [schema={}, table={}, index={}]", exception, schemaName, tableName, indexName); diff --git a/modules/replicator/src/main/java/org/apache/ignite/internal/raft/client/TopologyAwareRaftGroupService.java b/modules/replicator/src/main/java/org/apache/ignite/internal/raft/client/TopologyAwareRaftGroupService.java index e5497ed98c..2da893f7f4 100644 --- a/modules/replicator/src/main/java/org/apache/ignite/internal/raft/client/TopologyAwareRaftGroupService.java +++ b/modules/replicator/src/main/java/org/apache/ignite/internal/raft/client/TopologyAwareRaftGroupService.java @@ -287,7 +287,7 @@ public class TopologyAwareRaftGroupService implements RaftGroupService { if (notifyOnSubscription) { return CompletableFuture.allOf(futs).whenCompleteAsync((unused, throwable) -> { if (throwable != null) { - throw new IgniteException(Common.UNEXPECTED_ERR, throwable); + throw new IgniteException(Common.INTERNAL_ERR, throwable); } refreshAndGetLeaderWithTerm().thenAcceptAsync(leaderWithTerm -> { diff --git a/modules/rest-api/src/test/java/org/apache/ignite/internal/rest/exception/handler/IgniteExceptionHandlerTest.java b/modules/rest-api/src/test/java/org/apache/ignite/internal/rest/exception/handler/IgniteExceptionHandlerTest.java index fe5b84c724..d7d8f7a4d6 100644 --- a/modules/rest-api/src/test/java/org/apache/ignite/internal/rest/exception/handler/IgniteExceptionHandlerTest.java +++ b/modules/rest-api/src/test/java/org/apache/ignite/internal/rest/exception/handler/IgniteExceptionHandlerTest.java @@ -19,7 +19,7 @@ package org.apache.ignite.internal.rest.exception.handler; import static org.apache.ignite.lang.ErrorGroup.extractErrorCode; import static org.apache.ignite.lang.ErrorGroups.Common.COMMON_ERR_GROUP; -import static org.apache.ignite.lang.ErrorGroups.Common.UNKNOWN_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; @@ -47,7 +47,7 @@ class IgniteExceptionHandlerTest { static Stream<Arguments> igniteExceptions() { UUID traceId = UUID.randomUUID(); - String humanReadableCode = ErrorGroup.ERR_PREFIX + COMMON_ERR_GROUP.name() + '-' + extractErrorCode(UNKNOWN_ERR); + String humanReadableCode = ErrorGroup.ERR_PREFIX + COMMON_ERR_GROUP.name() + '-' + extractErrorCode(INTERNAL_ERR); var invalidParams = List.of( new InvalidParam("key1", "Some issue1"), @@ -60,7 +60,7 @@ class IgniteExceptionHandlerTest { return Stream.of( Arguments.of( // given - new IgniteException(traceId, UNKNOWN_ERR, "Ooops"), + new IgniteException(traceId, INTERNAL_ERR, "Ooops"), // expected Problem.builder() .status(500) @@ -70,7 +70,7 @@ class IgniteExceptionHandlerTest { .traceId(traceId)), Arguments.of( // given - new IgniteException(traceId, UNKNOWN_ERR), + new IgniteException(traceId, INTERNAL_ERR), // expected Problem.builder() .status(500) @@ -79,7 +79,7 @@ class IgniteExceptionHandlerTest { .traceId(traceId)), Arguments.of( // given - new IgniteException(traceId, UNKNOWN_ERR, new IllegalArgumentException("Illegal value")), + new IgniteException(traceId, INTERNAL_ERR, new IllegalArgumentException("Illegal value")), // expected Problem.builder() .status(400) @@ -91,7 +91,7 @@ class IgniteExceptionHandlerTest { // given new IgniteException( traceId, - UNKNOWN_ERR, + INTERNAL_ERR, new ConfigurationValidationException(validationIssues)), // expected Problem.builder() diff --git a/modules/rest/src/main/java/org/apache/ignite/internal/rest/RestComponent.java b/modules/rest/src/main/java/org/apache/ignite/internal/rest/RestComponent.java index a7a29def2f..330a6e00ea 100644 --- a/modules/rest/src/main/java/org/apache/ignite/internal/rest/RestComponent.java +++ b/modules/rest/src/main/java/org/apache/ignite/internal/rest/RestComponent.java @@ -130,7 +130,7 @@ public class RestComponent implements IgniteComponent { + " [HTTP ports=[" + desiredHttpPort + ", " + desiredHttpPort + portRange + "]]," + " [HTTPS ports=[" + desiredHttpsPort + ", " + desiredHttpsPort + httpsPortRange + "]]"; - throw new IgniteException(Common.UNEXPECTED_ERR, msg); + throw new IgniteException(Common.COMPONENT_NOT_STARTED_ERR, msg); } /** Starts Micronaut application using the provided ports. @@ -154,7 +154,7 @@ public class RestComponent implements IgniteComponent { if (bindException != null) { return false; } - throw new IgniteException(Common.UNEXPECTED_ERR, e); + throw new IgniteException(Common.COMPONENT_NOT_STARTED_ERR, e); } } diff --git a/modules/rest/src/main/java/org/apache/ignite/internal/rest/authentication/NodeOnlyEndpointsFilter.java b/modules/rest/src/main/java/org/apache/ignite/internal/rest/authentication/NodeOnlyEndpointsFilter.java index 47c3ba722a..1b7414afd5 100644 --- a/modules/rest/src/main/java/org/apache/ignite/internal/rest/authentication/NodeOnlyEndpointsFilter.java +++ b/modules/rest/src/main/java/org/apache/ignite/internal/rest/authentication/NodeOnlyEndpointsFilter.java @@ -75,7 +75,7 @@ public class NodeOnlyEndpointsFilter implements HttpServerFilter { )); } } catch (InterruptedException | ExecutionException | TimeoutException e) { - throw new IgniteException(Common.UNEXPECTED_ERR, e); + throw new IgniteException(Common.INTERNAL_ERR, e); } return chain.proceed(request); diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java index 279920cd9f..b73648ac1f 100644 --- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java +++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientComputeTest.java @@ -17,7 +17,7 @@ package org.apache.ignite.internal.runner.app.client; -import static org.apache.ignite.lang.ErrorGroups.Common.UNEXPECTED_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import static org.apache.ignite.lang.ErrorGroups.Table.COLUMN_ALREADY_EXISTS_ERR; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; @@ -158,7 +158,7 @@ public class ItThinClientComputeTest extends ItAbstractThinClientTest { var cause = (IgniteException) ex.getCause(); assertThat(cause.getMessage(), containsString("NullPointerException: null ref")); - assertEquals(UNEXPECTED_ERR, cause.code()); + assertEquals(INTERNAL_ERR, cause.code()); assertNull(cause.getCause()); // No stack trace by default. } @@ -172,7 +172,7 @@ public class ItThinClientComputeTest extends ItAbstractThinClientTest { var cause = (IgniteException) ex.getCause(); assertThat(cause.getMessage(), containsString("NullPointerException: null ref")); - assertEquals(UNEXPECTED_ERR, cause.code()); + assertEquals(INTERNAL_ERR, cause.code()); assertNotNull(cause.getCause()); assertThat(cause.getCause().getMessage(), containsString( diff --git a/modules/runner/src/main/java/org/apache/ignite/internal/component/RestAddressReporter.java b/modules/runner/src/main/java/org/apache/ignite/internal/component/RestAddressReporter.java index af5447fecf..884fe2ed18 100644 --- a/modules/runner/src/main/java/org/apache/ignite/internal/component/RestAddressReporter.java +++ b/modules/runner/src/main/java/org/apache/ignite/internal/component/RestAddressReporter.java @@ -52,7 +52,7 @@ public class RestAddressReporter { Files.writeString(workDir.resolve(REPORT_FILE_NAME), report(httpAddress, httpsAddress)); } catch (IOException e) { String message = "Unexpected error when trying to write REST server network address to file"; - throw new IgniteException(Common.UNEXPECTED_ERR, message, e); + throw new IgniteException(Common.INTERNAL_ERR, message, e); } } @@ -77,7 +77,7 @@ public class RestAddressReporter { Files.delete(workDir.resolve(REPORT_FILE_NAME)); } catch (IOException e) { String message = "Unexpected error when trying to remove REST server network address file"; - LOG.error(message, new IgniteException(Common.UNEXPECTED_ERR, message, e)); + LOG.error(message, new IgniteException(Common.INTERNAL_ERR, message, e)); } } } diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/NativeTypeSpec.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/NativeTypeSpec.java index b7b6e732a2..7368020819 100644 --- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/NativeTypeSpec.java +++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/NativeTypeSpec.java @@ -368,7 +368,7 @@ public enum NativeTypeSpec { ColumnType columnType = asColumnTypeOrNull(); if (columnType == null) { - throw new IgniteException(Common.UNEXPECTED_ERR, "Unsupported native type: " + this); + throw new IgniteException(Common.INTERNAL_ERR, "Unsupported native type: " + this); } return columnType; diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/SessionImpl.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/SessionImpl.java index 58d56d6628..fe01043c56 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/SessionImpl.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/SessionImpl.java @@ -17,7 +17,7 @@ package org.apache.ignite.internal.sql.api; -import static org.apache.ignite.lang.ErrorGroups.Common.UNEXPECTED_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import static org.apache.ignite.lang.ErrorGroups.Sql.INVALID_DML_RESULT_ERR; import static org.apache.ignite.lang.ErrorGroups.Sql.OPERATION_INTERRUPTED_ERR; import static org.apache.ignite.lang.ErrorGroups.Sql.SESSION_NOT_FOUND_ERR; @@ -270,7 +270,7 @@ public class SessionImpl implements Session { Throwable cause = ExceptionUtils.unwrapCause(ex); throw new SqlBatchException( - cause instanceof IgniteException ? ((IgniteException) cause).code() : UNEXPECTED_ERR, + cause instanceof IgniteException ? ((IgniteException) cause).code() : INTERNAL_ERR, counters.toArray(ArrayUtils.LONG_EMPTY_ARRAY), ex); }) diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExchangeServiceImpl.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExchangeServiceImpl.java index 0027f8f94e..e6ab04b208 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExchangeServiceImpl.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExchangeServiceImpl.java @@ -17,7 +17,7 @@ package org.apache.ignite.internal.sql.engine.exec; -import static org.apache.ignite.lang.ErrorGroups.Common.UNEXPECTED_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import static org.apache.ignite.lang.IgniteStringFormatter.format; import java.util.List; @@ -145,7 +145,7 @@ public class ExchangeServiceImpl implements ExchangeService { return new SqlException(iex.traceId(), iex.code(), iex.getMessage(), iex); } else { - return new SqlException(UNEXPECTED_ERR, cause); + return new SqlException(INTERNAL_ERR, cause); } } @@ -163,7 +163,7 @@ public class ExchangeServiceImpl implements ExchangeService { } catch (Throwable e) { outbox.onError(e); - throw new IgniteInternalException(UNEXPECTED_ERR, "Unexpected exception", e); + throw new IgniteInternalException(INTERNAL_ERR, "Unexpected exception", e); } }; @@ -183,7 +183,7 @@ public class ExchangeServiceImpl implements ExchangeService { } catch (Throwable e) { inbox.onError(e); - throw new IgniteInternalException(UNEXPECTED_ERR, "Unexpected exception", e); + throw new IgniteInternalException(INTERNAL_ERR, "Unexpected exception", e); } } else if (LOG.isDebugEnabled()) { LOG.debug("Stale batch message received: [nodeName={}, queryId={}, fragmentId={}, exchangeId={}, batchId={}]", diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionContext.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionContext.java index 3a8770f1ea..05436c62da 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionContext.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionContext.java @@ -17,7 +17,7 @@ package org.apache.ignite.internal.sql.engine.exec; -import static org.apache.ignite.lang.ErrorGroups.Common.UNEXPECTED_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import java.lang.reflect.Type; import java.util.List; @@ -317,7 +317,7 @@ public class ExecutionContext<RowT> extends AbstractQueryContext implements Data } catch (Throwable e) { onError.accept(e); - throw new IgniteInternalException(UNEXPECTED_ERR, "Unexpected exception", e); + throw new IgniteInternalException(INTERNAL_ERR, "Unexpected exception", e); } }); } @@ -338,7 +338,7 @@ public class ExecutionContext<RowT> extends AbstractQueryContext implements Data } catch (Throwable e) { onError.accept(e); - throw new IgniteInternalException(UNEXPECTED_ERR, "Unexpected exception", e); + throw new IgniteInternalException(INTERNAL_ERR, "Unexpected exception", e); } }); } diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java index 062d53155a..fafa31af4f 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java @@ -85,7 +85,7 @@ import org.apache.ignite.internal.sql.engine.util.HashFunctionFactoryImpl; import org.apache.ignite.internal.sql.engine.util.TypeUtils; import org.apache.ignite.internal.tx.InternalTransaction; import org.apache.ignite.internal.util.ExceptionUtils; -import org.apache.ignite.lang.ErrorGroups.Sql; +import org.apache.ignite.lang.ErrorGroups.Common; import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.lang.IgniteInternalCheckedException; import org.apache.ignite.lang.IgniteInternalException; @@ -685,7 +685,7 @@ public class ExecutionServiceImpl<RowT> implements ExecutionService, TopologyEve throw ExceptionUtils.withCauseAndCode( IgniteInternalException::new, - Sql.INTERNAL_ERR, + Common.INTERNAL_ERR, format("Unable to send fragment [targetNode={}, fragmentId={}, cause={}]", nodeName, fragment.fragmentId(), t.getMessage()), t diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/Inbox.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/Inbox.java index 81aade9a57..15338dd44f 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/Inbox.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/Inbox.java @@ -36,7 +36,7 @@ import org.apache.ignite.internal.sql.engine.exec.MailboxRegistry; import org.apache.ignite.internal.sql.engine.exec.SharedState; import org.apache.ignite.internal.sql.engine.exec.rel.Inbox.RemoteSource.State; import org.apache.ignite.internal.util.ExceptionUtils; -import org.apache.ignite.lang.ErrorGroups.Sql; +import org.apache.ignite.lang.ErrorGroups.Common; import org.apache.ignite.lang.IgniteInternalCheckedException; import org.apache.ignite.lang.IgniteInternalException; import org.jetbrains.annotations.Nullable; @@ -339,7 +339,7 @@ public class Inbox<RowT> extends AbstractNode<RowT> implements Mailbox<RowT>, Si if (ex != null) { IgniteInternalException wrapperEx = ExceptionUtils.withCauseAndCode( IgniteInternalException::new, - Sql.INTERNAL_ERR, + Common.INTERNAL_ERR, "Unable to request next batch: " + ex.getMessage(), ex ); diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/Outbox.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/Outbox.java index 0e30d48d4e..387a25dbbc 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/Outbox.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/Outbox.java @@ -36,7 +36,7 @@ import org.apache.ignite.internal.sql.engine.exec.SharedState; import org.apache.ignite.internal.sql.engine.trait.Destination; import org.apache.ignite.internal.sql.engine.util.Commons; import org.apache.ignite.internal.util.ExceptionUtils; -import org.apache.ignite.lang.ErrorGroups.Sql; +import org.apache.ignite.lang.ErrorGroups.Common; import org.apache.ignite.lang.IgniteInternalCheckedException; import org.apache.ignite.lang.IgniteInternalException; import org.jetbrains.annotations.Nullable; @@ -240,7 +240,7 @@ public class Outbox<RowT> extends AbstractNode<RowT> implements Mailbox<RowT>, S IgniteInternalException wrapperEx = ExceptionUtils.withCauseAndCode( IgniteInternalException::new, - Sql.INTERNAL_ERR, + Common.INTERNAL_ERR, "Unable to send batch: " + ex.getMessage(), ex ); @@ -262,7 +262,7 @@ public class Outbox<RowT> extends AbstractNode<RowT> implements Mailbox<RowT>, S IgniteInternalException wrapperEx = ExceptionUtils.withCauseAndCode( IgniteInternalException::new, - Sql.INTERNAL_ERR, + Common.INTERNAL_ERR, "Unable to send error: " + ex.getMessage(), ex ); diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/RootNode.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/RootNode.java index 8ade568a08..ad57d85260 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/RootNode.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/RootNode.java @@ -18,7 +18,7 @@ package org.apache.ignite.internal.sql.engine.exec.rel; import static org.apache.ignite.internal.util.CollectionUtils.nullOrEmpty; -import static org.apache.ignite.lang.ErrorGroups.Common.UNEXPECTED_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import static org.apache.ignite.lang.ErrorGroups.Sql.OPERATION_INTERRUPTED_ERR; import com.google.common.base.Functions; @@ -286,7 +286,7 @@ public class RootNode<RowT> extends AbstractNode<RowT> implements SingleNode<Row if (e instanceof RuntimeException) { throw (RuntimeException) e; } else { - throw new IgniteInternalException(UNEXPECTED_ERR, "An error occurred while query executing.", e); + throw new IgniteInternalException(INTERNAL_ERR, "An error occurred while query executing.", e); } // TODO: rework with SQL error code // if (e instanceof IgniteSQLException) diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/trait/TraitUtils.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/trait/TraitUtils.java index 5e5b8a7da3..858a6380b5 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/trait/TraitUtils.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/trait/TraitUtils.java @@ -497,7 +497,7 @@ public class TraitUtils { case DESC_NULLS_FIRST: return new RelFieldCollation(fieldIdx, RelFieldCollation.Direction.DESCENDING, RelFieldCollation.NullDirection.FIRST); default: - throw new IgniteInternalException(Common.UNEXPECTED_ERR, format("Unknown collation [collation={}]", collation)); + throw new IgniteInternalException(Common.INTERNAL_ERR, format("Unknown collation [collation={}]", collation)); } } diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImplTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImplTest.java index a9d34fcde6..28b85ee041 100644 --- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImplTest.java +++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImplTest.java @@ -101,7 +101,7 @@ import org.apache.ignite.internal.sql.engine.util.HashFunctionFactoryImpl; import org.apache.ignite.internal.testframework.IgniteTestUtils.RunnableX; import org.apache.ignite.internal.tx.InternalTransaction; import org.apache.ignite.internal.util.ArrayUtils; -import org.apache.ignite.lang.ErrorGroups.Sql; +import org.apache.ignite.lang.ErrorGroups.Common; import org.apache.ignite.lang.IgniteInternalException; import org.apache.ignite.network.ClusterNode; import org.apache.ignite.network.NetworkAddress; @@ -431,7 +431,7 @@ public class ExecutionServiceImplTest { return CompletableFuture.completedFuture(null); } else { // On other nodes, simulate that the node has already gone. - return CompletableFuture.failedFuture(new IgniteInternalException(Sql.INTERNAL_ERR, + return CompletableFuture.failedFuture(new IgniteInternalException(Common.INTERNAL_ERR, "Connection refused to " + node.nodeName + ", message " + msg)); } })); diff --git a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java index 226b51c8d3..077476e8c4 100644 --- a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java +++ b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java @@ -21,7 +21,7 @@ import static it.unimi.dsi.fastutil.ints.Int2ObjectMaps.emptyMap; import static java.util.concurrent.CompletableFuture.completedFuture; import static java.util.concurrent.CompletableFuture.failedFuture; import static org.apache.ignite.internal.util.ExceptionUtils.withCause; -import static org.apache.ignite.lang.ErrorGroups.Common.UNEXPECTED_ERR; +import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR; import static org.apache.ignite.lang.ErrorGroups.Replicator.REPLICA_UNAVAILABLE_ERR; import static org.apache.ignite.lang.ErrorGroups.Transactions.ACQUIRE_LOCK_ERR; import static org.apache.ignite.lang.ErrorGroups.Transactions.TX_FAILED_READ_WRITE_OPERATION_ERR; @@ -1476,7 +1476,7 @@ public class InternalTableImpl implements InternalTable { } else if (e instanceof LockException) { e0 = withCause(TransactionException::new, ACQUIRE_LOCK_ERR, e); } else if (!(e instanceof RuntimeException)) { - e0 = withCause(IgniteException::new, UNEXPECTED_ERR, e); + e0 = withCause(IgniteException::new, INTERNAL_ERR, e); } else { e0 = (RuntimeException) e; }