Skip to content

Commit

Permalink
Refine exception process
Browse files Browse the repository at this point in the history
  • Loading branch information
oxsean committed Sep 3, 2024
1 parent 51f4f74 commit e5ef073
Show file tree
Hide file tree
Showing 52 changed files with 1,121 additions and 953 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 e5ef073

Please sign in to comment.