This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new f5f0f16744d Adjust AlgorithmDefinitionException‘s error codes (#30701)
f5f0f16744d is described below
commit f5f0f16744d38674e6b004dc6270a819bc5bc42f
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Mar 30 19:02:51 2024 +0800
Adjust AlgorithmDefinitionException‘s error codes (#30701)
---
.../content/user-manual/error-code/sql-error-code.cn.md | 12 ++++++------
.../content/user-manual/error-code/sql-error-code.en.md | 12 ++++++------
.../core/exception/type/AlgorithmExecuteException.java | 2 +-
.../exception/type/AlgorithmInitializationException.java | 2 +-
.../core/exception/type/EmptyAlgorithmException.java | 2 +-
.../core/exception/type/InUsedAlgorithmException.java | 2 +-
.../type/InvalidAlgorithmConfigurationException.java | 4 ++--
.../core/exception/type/UnregisteredAlgorithmException.java | 4 ++--
8 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/docs/document/content/user-manual/error-code/sql-error-code.cn.md
b/docs/document/content/user-manual/error-code/sql-error-code.cn.md
index 03ad9a6c634..197e243cb2e 100644
--- a/docs/document/content/user-manual/error-code/sql-error-code.cn.md
+++ b/docs/document/content/user-manual/error-code/sql-error-code.cn.md
@@ -26,12 +26,6 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| HY000 | 10022 | Can not load table with database name \`%s\` and
data source name \`%s\`. |
| 0A000 | 10030 | Can not drop schema \`%s\` because of contains
tables. |
| 0A000 | 10040 | Unsupported storage type of \`%s.%s\`.
|
-| 44000 | 10090 | Algorithm '%s.'%s' initialization failed, reason
is: %s. |
-| 44000 | 10091 | '%s' algorithm on %s is required.
|
-| 42S02 | 10092 | '%s' algorithm '%s' on %s is unregistered.
|
-| 44000 | 10093 | %s algorithms '%s' in database '%s' are still in
used. |
-| 44000 | 10094 | Invalid %s algorithm configuration '%s'.
|
-| HY000 | 10099 | Algorithm '%s.%s' execute failed, reason is: %s.
|
| 44000 | 10100 | Can not process invalid storage units, error
messages are: %s |
| 44000 | 10101 | Storage units \`%s\` do not exist in database
\`%s\`. |
| 44000 | 10102 | There is no storage unit in the database \`%s\`.
|
@@ -40,6 +34,12 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 44000 | 10105 | Invalid storage unit status, error message is: %s.
|
| 44000 | 10106 | Read storage unit \`%s\` does not exist in rule
\`%s\`. |
| 42000 | 10107 | There is no storage unit in database \`%s\`.
|
+| 44000 | 10300 | Algorithm '%s.'%s' initialization failed, reason
is: %s. |
+| 44000 | 10301 | '%s' algorithm on %s is required.
|
+| 42S02 | 10302 | '%s' algorithm '%s' on %s is unregistered.
|
+| 44000 | 10303 | %s algorithms '%s' in database '%s' are still in
used. |
+| 44000 | 10304 | Invalid %s algorithm configuration '%s'.
|
+| HY000 | 10309 | Algorithm '%s.%s' execute failed, reason is: %s.
|
### 数据
diff --git a/docs/document/content/user-manual/error-code/sql-error-code.en.md
b/docs/document/content/user-manual/error-code/sql-error-code.en.md
index 11db959311a..65bed95a23c 100644
--- a/docs/document/content/user-manual/error-code/sql-error-code.en.md
+++ b/docs/document/content/user-manual/error-code/sql-error-code.en.md
@@ -30,12 +30,6 @@ SQL error codes provide by standard `SQL State`, `Vendor
Code` and `Reason`, whi
| HY000 | 10022 | Can not load table with database name \`%s\` and
data source name \`%s\`. |
| 0A000 | 10030 | Can not drop schema \`%s\` because of contains
tables. |
| 0A000 | 10040 | Unsupported storage type of \`%s.%s\`.
|
-| 44000 | 10090 | Algorithm '%s.'%s' initialization failed, reason
is: %s. |
-| 44000 | 10091 | '%s' algorithm on %s is required.
|
-| 42S02 | 10092 | '%s' algorithm '%s' on %s is unregistered.
|
-| 44000 | 10093 | %s algorithms '%s' in database '%s' are still in
used. |
-| 44000 | 10094 | Invalid %s algorithm configuration '%s'.
|
-| HY000 | 10099 | Algorithm '%s.%s' execute failed, reason is: %s.
|
| 44000 | 10100 | Can not process invalid storage units, error
messages are: %s |
| 44000 | 10101 | Storage units \`%s\` do not exist in database
\`%s\`. |
| 44000 | 10102 | There is no storage unit in the database \`%s\`.
|
@@ -44,6 +38,12 @@ SQL error codes provide by standard `SQL State`, `Vendor
Code` and `Reason`, whi
| 44000 | 10105 | Invalid storage unit status, error message is: %s.
|
| 44000 | 10106 | Read storage unit \`%s\` does not exist in rule
\`%s\`. |
| 42000 | 10107 | There is no storage unit in database \`%s\`.
|
+| 44000 | 10300 | Algorithm '%s.'%s' initialization failed, reason
is: %s. |
+| 44000 | 10301 | '%s' algorithm on %s is required.
|
+| 42S02 | 10302 | '%s' algorithm '%s' on %s is unregistered.
|
+| 44000 | 10303 | %s algorithms '%s' in database '%s' are still in
used. |
+| 44000 | 10304 | Invalid %s algorithm configuration '%s'.
|
+| HY000 | 10309 | Algorithm '%s.%s' execute failed, reason is: %s.
|
### Data
diff --git
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/AlgorithmExecuteException.java
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/AlgorithmExecuteException.java
index 027821a2a25..d48b8a2d440 100644
---
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/AlgorithmExecuteException.java
+++
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/AlgorithmExecuteException.java
@@ -29,7 +29,7 @@ public final class AlgorithmExecuteException extends
AlgorithmDefinitionExceptio
private static final long serialVersionUID = -9099514178650043282L;
public AlgorithmExecuteException(final ShardingSphereAlgorithm algorithm,
final String reason, final Object... args) {
- super(XOpenSQLState.GENERAL_ERROR, 99, "Algorithm '%s.%s' execute
failed, reason is: %s.",
+ super(XOpenSQLState.GENERAL_ERROR, 309, "Algorithm '%s.%s' execute
failed, reason is: %s.",
algorithm.getClass().getSuperclass().getSimpleName(),
algorithm.getType(), String.format(reason, args));
}
}
diff --git
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/AlgorithmInitializationException.java
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/AlgorithmInitializationException.java
index efa8114a073..69a499f5d57 100644
---
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/AlgorithmInitializationException.java
+++
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/AlgorithmInitializationException.java
@@ -29,7 +29,7 @@ public final class AlgorithmInitializationException extends
AlgorithmDefinitionE
private static final long serialVersionUID = -7634670846091616790L;
public AlgorithmInitializationException(final ShardingSphereAlgorithm
algorithm, final String reason, final Object... args) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 90, "Algorithm '%s.'%s'
initialization failed, reason is: %s.",
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 300, "Algorithm '%s.'%s'
initialization failed, reason is: %s.",
algorithm.getClass().getSuperclass().getSimpleName(),
algorithm.getType(), String.format(reason, args));
}
}
diff --git
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/EmptyAlgorithmException.java
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/EmptyAlgorithmException.java
index 46c15b2fa7b..a23b0bdfb03 100644
---
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/EmptyAlgorithmException.java
+++
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/EmptyAlgorithmException.java
@@ -29,6 +29,6 @@ public final class EmptyAlgorithmException extends
AlgorithmDefinitionException
private static final long serialVersionUID = 8128067899672436211L;
public EmptyAlgorithmException(final String algorithmType, final
SQLExceptionIdentifier sqlExceptionIdentifier) {
- super(XOpenSQLState.NOT_FOUND, 91, "'%s' algorithm on %s is
required.", algorithmType, sqlExceptionIdentifier);
+ super(XOpenSQLState.NOT_FOUND, 301, "'%s' algorithm on %s is
required.", algorithmType, sqlExceptionIdentifier);
}
}
diff --git
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/InUsedAlgorithmException.java
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/InUsedAlgorithmException.java
index cb4ba4d2454..52bc9c89215 100644
---
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/InUsedAlgorithmException.java
+++
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/InUsedAlgorithmException.java
@@ -30,6 +30,6 @@ public final class InUsedAlgorithmException extends
AlgorithmDefinitionException
private static final long serialVersionUID = -8735125626190637177L;
public InUsedAlgorithmException(final String type, final String
databaseName, final Collection<String> algorithmNames) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 93, "%s algorithms '%s' in
database '%s' are still in used.", type, algorithmNames, databaseName);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 303, "%s algorithms '%s'
in database '%s' are still in used.", type, algorithmNames, databaseName);
}
}
diff --git
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/InvalidAlgorithmConfigurationException.java
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/InvalidAlgorithmConfigurationException.java
index 6fc39f4d729..8863e95b505 100644
---
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/InvalidAlgorithmConfigurationException.java
+++
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/InvalidAlgorithmConfigurationException.java
@@ -28,10 +28,10 @@ public final class InvalidAlgorithmConfigurationException
extends AlgorithmDefin
private static final long serialVersionUID = 1352014079406440573L;
public InvalidAlgorithmConfigurationException(final String algorithmType,
final String algorithm) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 94, "Invalid %s algorithm
configuration '%s'.", algorithmType, algorithm);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 304, "Invalid %s algorithm
configuration '%s'.", algorithmType, algorithm);
}
public InvalidAlgorithmConfigurationException(final String algorithmType) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 94, "Invalid %s algorithm
configuration.", algorithmType);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 304, "Invalid %s algorithm
configuration.", algorithmType);
}
}
diff --git
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/UnregisteredAlgorithmException.java
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/UnregisteredAlgorithmException.java
index 037a34c0048..b116dce6987 100644
---
a/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/UnregisteredAlgorithmException.java
+++
b/infra/algorithm/core/src/main/java/org/apache/shardingsphere/infra/algorithm/core/exception/type/UnregisteredAlgorithmException.java
@@ -31,10 +31,10 @@ public final class UnregisteredAlgorithmException extends
AlgorithmDefinitionExc
private static final long serialVersionUID = -4570489906443880879L;
public UnregisteredAlgorithmException(final String algorithmType, final
String algorithmName, final SQLExceptionIdentifier sqlExceptionIdentifier) {
- super(XOpenSQLState.NOT_FOUND, 92, "'%s' algorithm '%s' on %s is
unregistered.", algorithmType, algorithmName, sqlExceptionIdentifier);
+ super(XOpenSQLState.NOT_FOUND, 302, "'%s' algorithm '%s' on %s is
unregistered.", algorithmType, algorithmName, sqlExceptionIdentifier);
}
public UnregisteredAlgorithmException(final String algorithmType, final
Collection<String> algorithmNames, final SQLExceptionIdentifier
sqlExceptionIdentifier) {
- super(XOpenSQLState.NOT_FOUND, 92, "'%s' algorithm '%s' on %s are
unregistered.", algorithmType, String.join(", ", algorithmNames),
sqlExceptionIdentifier);
+ super(XOpenSQLState.NOT_FOUND, 302, "'%s' algorithm '%s' on %s are
unregistered.", algorithmType, String.join(", ", algorithmNames),
sqlExceptionIdentifier);
}
}