You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/09/23 23:33:19 UTC
[shardingsphere] branch master updated: Update server error code doc (#21160)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 c3596089f4b Update server error code doc (#21160)
c3596089f4b is described below
commit c3596089f4bfccd5d2b02b164c203f72e5d779be
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Sep 24 07:33:09 2022 +0800
Update server error code doc (#21160)
* Update server error code doc
* Update server error code doc
* Fix test cases
* Fix test cases
---
.../content/user-manual/error-code/server-error-code.cn.md | 8 +++++++-
.../content/user-manual/error-code/server-error-code.en.md | 8 +++++++-
.../infra/util/props/exception/TypedPropertyValueException.java | 2 +-
.../spi/exception/ServiceProviderNotFoundServerException.java | 4 ++--
.../util/props/exception/TypedPropertyValueExceptionTest.java | 2 +-
.../util/spi/exception/ServiceProviderNotFoundExceptionTest.java | 4 ++--
6 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/docs/document/content/user-manual/error-code/server-error-code.cn.md b/docs/document/content/user-manual/error-code/server-error-code.cn.md
index d2921eb7944..97b53732e36 100644
--- a/docs/document/content/user-manual/error-code/server-error-code.cn.md
+++ b/docs/document/content/user-manual/error-code/server-error-code.cn.md
@@ -6,4 +6,10 @@ chapter = true
服务器发生错误时所提供的唯一错误码,打印在 Proxy 后端或 JDBC 启动日志中。
-TODO
+| 错误码 | 错误信息 |
+| --------------------- | ------ |
+| SPI-00001 | No implementation class load from SPI \`%s\` with type \`%s\` |
+| PROPS-00001 | Value \`%s\` of \`%s\` cannot convert to type \`%s\` |
+| PROXY-00001 | Load database server info failed |
+| SPRING-00001 | Can not find JNDI data source |
+| SPRING-SHARDING-00001 | Can not support type \`%s\` |
diff --git a/docs/document/content/user-manual/error-code/server-error-code.en.md b/docs/document/content/user-manual/error-code/server-error-code.en.md
index b1a98abb37c..cb2db60143d 100644
--- a/docs/document/content/user-manual/error-code/server-error-code.en.md
+++ b/docs/document/content/user-manual/error-code/server-error-code.en.md
@@ -6,4 +6,10 @@ chapter = true
Unique codes provided when server exception occur, which printed by Proxy backend or JDBC startup logs.
-TODO
+| Error Code | Reason |
+| --------------------- | ------ |
+| SPI-00001 | No implementation class load from SPI \`%s\` with type \`%s\` |
+| PROPS-00001 | Value \`%s\` of \`%s\` cannot convert to type \`%s\` |
+| PROXY-00001 | Load database server info failed |
+| SPRING-00001 | Can not find JNDI data source |
+| SPRING-SHARDING-00001 | Can not support type \`%s\` |
diff --git a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueException.java b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueException.java
index 7f20ada0d56..0f3c5138b24 100644
--- a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueException.java
+++ b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueException.java
@@ -28,6 +28,6 @@ public final class TypedPropertyValueException extends ShardingSphereInternalExc
private static final long serialVersionUID = -2989212435757964906L;
public TypedPropertyValueException(final TypedPropertyKey key, final String value) {
- super("Value `%s` of `%s` cannot convert to type `%s`.", value, key.getKey(), key.getType().getName());
+ super("Value `%s` of `%s` cannot convert to type `%s`", value, key.getKey(), key.getType().getName());
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundServerException.java b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundServerException.java
index d82222bd41e..1307ad77fb8 100644
--- a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundServerException.java
+++ b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundServerException.java
@@ -31,10 +31,10 @@ public final class ServiceProviderNotFoundServerException extends ShardingSphere
private static final int ERROR_CODE = 1;
public ServiceProviderNotFoundServerException(final Class<?> clazz) {
- super(ERROR_CATEGORY, ERROR_CODE, String.format("No implementation class load from SPI `%s`.", clazz.getName()));
+ super(ERROR_CATEGORY, ERROR_CODE, String.format("No implementation class load from SPI `%s`", clazz.getName()));
}
public ServiceProviderNotFoundServerException(final Class<?> clazz, final String type) {
- super(ERROR_CATEGORY, ERROR_CODE, String.format("No implementation class load from SPI `%s` with type `%s`.", clazz.getName(), type));
+ super(ERROR_CATEGORY, ERROR_CODE, String.format("No implementation class load from SPI `%s` with type `%s`", clazz.getName(), type));
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueExceptionTest.java b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueExceptionTest.java
index 797625b5187..0cf0e0a5ee8 100644
--- a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueExceptionTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertyValueExceptionTest.java
@@ -27,6 +27,6 @@ public final class TypedPropertyValueExceptionTest {
@Test
public void assertGetMessage() {
- assertThat(new TypedPropertyValueException(TypedPropertyKeyFixture.INT_VALUE, "test").getMessage(), is("Value `test` of `int` cannot convert to type `int`."));
+ assertThat(new TypedPropertyValueException(TypedPropertyKeyFixture.INT_VALUE, "test").getMessage(), is("Value `test` of `int` cannot convert to type `int`"));
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundExceptionTest.java b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundExceptionTest.java
index 0db13c5df6c..f9d0632dcb4 100644
--- a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundExceptionTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundExceptionTest.java
@@ -26,11 +26,11 @@ public final class ServiceProviderNotFoundExceptionTest {
@Test
public void assertGetMessageWithClassOnly() {
- assertThat(new ServiceProviderNotFoundServerException(Object.class).getMessage(), is("SPI-00001: No implementation class load from SPI `java.lang.Object`."));
+ assertThat(new ServiceProviderNotFoundServerException(Object.class).getMessage(), is("SPI-00001: No implementation class load from SPI `java.lang.Object`"));
}
@Test
public void assertGetMessageWithClassAndType() {
- assertThat(new ServiceProviderNotFoundServerException(Object.class, "Foo").getMessage(), is("SPI-00001: No implementation class load from SPI `java.lang.Object` with type `Foo`."));
+ assertThat(new ServiceProviderNotFoundServerException(Object.class, "Foo").getMessage(), is("SPI-00001: No implementation class load from SPI `java.lang.Object` with type `Foo`"));
}
}