|
@@ -4,6 +4,7 @@ import cn.reghao.jutil.jdk.exception.ExceptionUtil;
|
|
|
import cn.reghao.tnb.common.web.WebResult;
|
|
import cn.reghao.tnb.common.web.WebResult;
|
|
|
import cn.reghao.tnb.common.auth.AuthException;
|
|
import cn.reghao.tnb.common.auth.AuthException;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.apache.dubbo.rpc.RpcException;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
@@ -37,6 +38,9 @@ public class ControllerExceptionHandler {
|
|
|
String msg;
|
|
String msg;
|
|
|
if (e instanceof NullPointerException) {
|
|
if (e instanceof NullPointerException) {
|
|
|
msg = ExceptionUtil.stackTrace(e);
|
|
msg = ExceptionUtil.stackTrace(e);
|
|
|
|
|
+ } else if (e instanceof RpcException) {
|
|
|
|
|
+ log.error("RPC exception: {}", e.getMessage());
|
|
|
|
|
+ msg = e.getMessage();
|
|
|
} else {
|
|
} else {
|
|
|
msg = ExceptionUtil.errorMsg(e);
|
|
msg = ExceptionUtil.errorMsg(e);
|
|
|
}
|
|
}
|