Skip to content

Commit

Permalink
Refine exception process (#14513)
Browse files Browse the repository at this point in the history
Co-authored-by: earthchen <earthchen1996@gmail.com>
  • Loading branch information
oxsean and EarthChen authored Sep 4, 2024
1 parent 3c48aa8 commit d8aeba3
Show file tree
Hide file tree
Showing 55 changed files with 1,141 additions and 927 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package org.apache.dubbo.common.utils;

import org.apache.dubbo.rpc.model.MethodDescriptor;

import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;
Expand Down Expand Up @@ -477,4 +479,22 @@ static String toShortString(Method method) {
sb.append(')');
return sb.toString();
}

static String toShortString(MethodDescriptor md) {
Method method = md.getMethod();
if (method == null) {
StringBuilder sb = new StringBuilder(64);
sb.append(md.getMethodName()).append('(');
Class<?>[] parameterTypes = md.getParameterClasses();
for (int i = 0, len = parameterTypes.length; i < len; i++) {
if (i > 0) {
sb.append(", ");
}
sb.append(parameterTypes[i].getSimpleName());
}
sb.append(')');
return sb.toString();
}
return toShortString(method);
}
}
2 changes: 2 additions & 0 deletions dubbo-common/src/main/resources/security/serialize.allowlist
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ com.alibaba.dubbo.rpc.service.GenericException
org.apache.dubbo.rpc.service.GenericException
org.apache.dubbo.rpc.RpcException
org.apache.dubbo.remoting.http12.ErrorResponse
org.apache.dubbo.remoting.http12.message.DefaultHttpResult
org.apache.dubbo.remoting.http12.exception.HttpResultPayloadException
org.apache.dubbo.common.url.component.ServiceConfigURL
org.apache.dubbo.common.URL
org.apache.dubbo.common.url.component.URLAddress
Expand Down
Loading

0 comments on commit d8aeba3

Please sign in to comment.