This is an automated email from the ASF dual-hosted git repository.
sunnianjun 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 e236d44dfeb Adjust ResourceDefinitionException's error codes (#30716)
e236d44dfeb is described below
commit e236d44dfebdbcf3b2ab442812046980dbe30bdd
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Mar 31 21:43:02 2024 +0800
Adjust ResourceDefinitionException's error codes (#30716)
---
docs/document/content/user-manual/error-code/sql-error-code.cn.md | 8 ++++----
docs/document/content/user-manual/error-code/sql-error-code.en.md | 8 ++++----
.../storageunit/AlterStorageUnitConnectionInfoException.java | 2 +-
.../infra/exception/storageunit/EmptyStorageUnitException.java | 4 ++--
.../storageunit/MissingRequiredStorageUnitsException.java | 2 +-
.../infra/exception/storageunit/StorageUnitsConnectException.java | 2 +-
6 files changed, 13 insertions(+), 13 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 0114ab57f73..d84f6b4792d 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
@@ -27,12 +27,12 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 0A000 | 10030 | Can not drop schema \`%s\` because of contains
tables. |
| 0A000 | 10040 | Unsupported storage type of \`%s.%s\`.
|
| 44000 | 10100 | Can not %s storage units '%s'.
|
-| 44000 | 10101 | Storage units '%s' do not exist in database '%s'.
|
-| 42S02 | 10102 | There is no storage unit in database '%s'.
|
+| 42S02 | 10101 | There is no storage unit in database '%s'.
|
+| 44000 | 10102 | Storage units '%s' do not exist in database '%s'.
|
| 44000 | 10103 | Storage unit '%s' still used by '%s'.
|
| 44000 | 10104 | Duplicate storage unit names '%s'.
|
-| 0A000 | 10108 | Can not alter connection info in storage units:
'%s'. |
-| 0A000 | 10109 | Storage units can not connect, error messages are:
%s. |
+| 0A000 | 10105 | Storage units can not connect, error messages are:
%s. |
+| 0A000 | 10106 | Can not alter connection info in storage units:
'%s'. |
| 44000 | 10120 | Invalid storage unit status, error message is: %s.
|
| 44000 | 10200 | Invalid '%s' rule '%s', error message is: %s
|
| 44000 | 10201 | %s rules '%s' do not exist in database '%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 cdee3823c90..6a679000f96 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
@@ -27,12 +27,12 @@ SQL error codes provide by standard `SQL State`, `Vendor
Code` and `Reason`, whi
| 0A000 | 10030 | Can not drop schema \`%s\` because of contains
tables. |
| 0A000 | 10040 | Unsupported storage type of \`%s.%s\`.
|
| 44000 | 10100 | Can not %s storage units '%s'.
|
-| 44000 | 10101 | Storage units '%s' do not exist in database '%s'.
|
-| 42S02 | 10102 | There is no storage unit in database '%s'.
|
+| 42S02 | 10101 | There is no storage unit in database '%s'.
|
+| 44000 | 10102 | Storage units '%s' do not exist in database '%s'.
|
| 44000 | 10103 | Storage unit '%s' still used by '%s'.
|
| 44000 | 10104 | Duplicate storage unit names '%s'.
|
-| 0A000 | 10108 | Can not alter connection info in storage units:
'%s'. |
-| 0A000 | 10109 | Storage units can not connect, error messages are:
%s. |
+| 0A000 | 10105 | Storage units can not connect, error messages are:
%s. |
+| 0A000 | 10106 | Can not alter connection info in storage units:
'%s'. |
| 44000 | 10120 | Invalid storage unit status, error message is: %s.
|
| 44000 | 10200 | Invalid '%s' rule '%s', error message is: %s
|
| 44000 | 10201 | %s rules '%s' do not exist in database '%s'.
|
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/AlterStorageUnitConnectionInfoException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/AlterStorageUnitConnectionInfoException.java
index d12ea46710f..a436a472512 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/AlterStorageUnitConnectionInfoException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/AlterStorageUnitConnectionInfoException.java
@@ -30,6 +30,6 @@ public final class AlterStorageUnitConnectionInfoException
extends ResourceDefin
private static final long serialVersionUID = 525999625052706626L;
public AlterStorageUnitConnectionInfoException(final Collection<String>
storageUnitNames) {
- super(XOpenSQLState.FEATURE_NOT_SUPPORTED, 8, "Can not alter
connection info in storage units: '%s'.", String.join(", ", storageUnitNames));
+ super(XOpenSQLState.FEATURE_NOT_SUPPORTED, 6, "Can not alter
connection info in storage units: '%s'.", String.join(", ", storageUnitNames));
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/EmptyStorageUnitException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/EmptyStorageUnitException.java
index c61e84b1870..d45334531bb 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/EmptyStorageUnitException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/EmptyStorageUnitException.java
@@ -28,10 +28,10 @@ public final class EmptyStorageUnitException extends
ResourceDefinitionException
private static final long serialVersionUID = 1704331180489268L;
public EmptyStorageUnitException() {
- super(XOpenSQLState.NOT_FOUND, 2, "There is no storage unit in any
database.");
+ super(XOpenSQLState.NOT_FOUND, 1, "There is no storage unit in any
database.");
}
public EmptyStorageUnitException(final String databaseName) {
- super(XOpenSQLState.NOT_FOUND, 2, "There is no storage unit in
database '%s'.", databaseName);
+ super(XOpenSQLState.NOT_FOUND, 1, "There is no storage unit in
database '%s'.", databaseName);
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/MissingRequiredStorageUnitsException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/MissingRequiredStorageUnitsException.java
index 264765c0708..cf8afec77d3 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/MissingRequiredStorageUnitsException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/MissingRequiredStorageUnitsException.java
@@ -30,6 +30,6 @@ public final class MissingRequiredStorageUnitsException
extends ResourceDefiniti
private static final long serialVersionUID = 1704331180489268L;
public MissingRequiredStorageUnitsException(final String databaseName,
final Collection<String> storageUnitNames) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "Storage units '%s' do
not exist in database '%s'.", storageUnitNames, databaseName);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 2, "Storage units '%s' do
not exist in database '%s'.", storageUnitNames, databaseName);
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/StorageUnitsConnectException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/StorageUnitsConnectException.java
index a4743f9a925..d7e3b620e09 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/StorageUnitsConnectException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/StorageUnitsConnectException.java
@@ -31,7 +31,7 @@ public final class StorageUnitsConnectException extends
ResourceDefinitionExcept
private static final long serialVersionUID = 1824912697040264268L;
public StorageUnitsConnectException(final Map<String, Exception> causes) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 9, "Storage units can not
connect, error messages are: %s.", causes.entrySet().stream().map(entry ->
String.format(
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 5, "Storage units can not
connect, error messages are: %s.", causes.entrySet().stream().map(entry ->
String.format(
"Storage unit name: '%s', error message is: %s",
entry.getKey(),
entry.getValue().getMessage())).collect(Collectors.joining(System.lineSeparator())));
}
}