Commit b0f0b8b5 by tyfanchz

移动feign配置到nacos上

1 parent cd9cebb4
...@@ -77,8 +77,13 @@ public class GlobalExceptionHandler { ...@@ -77,8 +77,13 @@ public class GlobalExceptionHandler {
@ExceptionHandler({FeignException.class}) @ExceptionHandler({FeignException.class})
public R handleFeignException(FeignException e) { public R handleFeignException(FeignException e) {
log.error("!!!! 远程服务错误", e); log.error("!!!! 远程服务错误", e);
JSONObject respObj = JSON.parseObject(e.contentUTF8()); String respMessage;
String respMessage = respObj.getString("message"); if (StringUtils.isNotBlank(e.contentUTF8())) {
JSONObject respObj = JSON.parseObject(e.contentUTF8());
respMessage = respObj.getString("message");
} else {
respMessage = "";
}
int code = ResultEnum.REMOTE_SERVICE_ERROR.getCode(); int code = ResultEnum.REMOTE_SERVICE_ERROR.getCode();
String message = StringUtils.isBlank(respMessage) String message = StringUtils.isBlank(respMessage)
? ResultEnum.REMOTE_SERVICE_ERROR.getMessage() : respMessage; ? ResultEnum.REMOTE_SERVICE_ERROR.getMessage() : respMessage;
......
...@@ -15,9 +15,6 @@ logging.level.org.springframework.boot.autoconfigure=off ...@@ -15,9 +15,6 @@ logging.level.org.springframework.boot.autoconfigure=off
logging.level.com.glsx.api=DEBUG logging.level.com.glsx.api=DEBUG
logging.path=/data/java_log/jetty/smartService/chejia-smart-api logging.path=/data/java_log/jetty/smartService/chejia-smart-api
feign.server.name=chejia-smart-service
feign.server.url=http://localhost:8209/smartService
dubbo.registry.address=zookeeper://192.168.1.36:2181?init.timeout=60000 dubbo.registry.address=zookeeper://192.168.1.36:2181?init.timeout=60000
dubbo.registry.timeout=10000 dubbo.registry.timeout=10000
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!