diff --git a/src/main/java/cn/stock/market/web/StockApiController.java b/src/main/java/cn/stock/market/web/StockApiController.java index cc78a7f..59a2e6e 100644 --- a/src/main/java/cn/stock/market/web/StockApiController.java +++ b/src/main/java/cn/stock/market/web/StockApiController.java @@ -126,9 +126,11 @@ public class StockApiController { @ResponseBody public ServerResponse getINDStockInfo(@RequestParam("stockCode") String stockCode) { ParamUtils.verify("股票代码", stockCode, ParamUtils.STRING_NOT_EMPTY_VERIFY_AND_CONVERT_VALUE); - - IndiaStockVO market = InvestingApis.of().market(StockCode.of(stockCode)); - if (market == null) { + + IndiaStockVO market = null; + try { + market = InvestingApis.of().market(StockCode.of(stockCode)); + } catch (Exception e) { return ServerResponse.createByErrorMsg("tips.msg.221"); } return ServerResponse.createBySuccess(market.toStockVo());