This is an automated email from the ASF dual-hosted git repository.
wankai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 25b2be13af Optimize the error message when decorator names conflict.
(#12727)
25b2be13af is described below
commit 25b2be13af27afe692714f0171e9d8fe7399230a
Author: Wan Kai <[email protected]>
AuthorDate: Mon Oct 28 09:42:16 2024 +0800
Optimize the error message when decorator names conflict. (#12727)
---
.../skywalking/oap/server/core/analysis/SourceDecoratorManager.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/SourceDecoratorManager.java
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/SourceDecoratorManager.java
index 25b9319a26..2dab850c55 100644
---
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/SourceDecoratorManager.java
+++
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/SourceDecoratorManager.java
@@ -54,7 +54,9 @@ public class SourceDecoratorManager {
ISourceDecorator<ISource> decorator = (ISourceDecorator)
aClass.newInstance();
ISourceDecorator<ISource> exist =
DECORATOR_MAP.put(aClass.getSimpleName(), decorator);
if (exist != null) {
- throw new IllegalStateException("Deprecated decorator:
" + aClass.getName() + " the class simple name is already used.");
+ throw new IllegalStateException(
+ "Conflict decorator names: The " +
aClass.getName() + " class simple name is the same with " +
exist.getClass().getName() +
+ ", please change the class simple name.");
}
log.info("Decorator {} is added into DefaultScopeDefine
{}.", decorator.getClass()
.getName(), ((ISource) source).scope());