diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java index feb4d2df..3293ee83 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoDataResourceService.java @@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; +import org.springframework.web.client.ResourceAccessException; import org.springframework.web.client.RestTemplate; import java.nio.charset.Charset; @@ -77,6 +78,9 @@ public class TsingtaoDataResourceService extends AbstractDataResourceService { result.put("data", objects); return result; + } catch (ResourceAccessException e) { + logger.error("青岛市资源数据接口连接超时!!!"); + return null; } catch (Exception e) { logger.error("青岛市资源数据调用失败!!!", e); return null; diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoXHADataResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoXHADataResourceService.java index a8a66e95..4b2fc8bb 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoXHADataResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dataResource/domain/TsingtaoXHADataResourceService.java @@ -11,6 +11,7 @@ import okhttp3.Request; import okhttp3.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.web.client.ResourceAccessException; import java.util.concurrent.TimeUnit; @@ -47,8 +48,12 @@ public class TsingtaoXHADataResourceService extends AbstractDataResourceService } else { logger.error("西海岸数据资源列表获取失败"); } - } catch (Exception exception) { - logger.error("西海岸数据资源列表获取失败", exception); + } catch (ResourceAccessException e) { + logger.error("西海岸资源数据接口连接超时!!!"); + return null; + } catch (Exception e) { + logger.error("西海岸资源数据调用失败!!!", e); + return null; } return result; }