From f08dc9b99c3b4466021f8729942b3fd74461dfdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=89=AF=28004796=29?= Date: Mon, 1 Apr 2024 10:10:24 +0800 Subject: [PATCH] 123 --- .../com/ruoyi/cai/ws/handler/message/GiftMessageHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ruoyi-cai/src/main/java/com/ruoyi/cai/ws/handler/message/GiftMessageHandler.java b/ruoyi-cai/src/main/java/com/ruoyi/cai/ws/handler/message/GiftMessageHandler.java index fd2e85cd..0f7dad0f 100644 --- a/ruoyi-cai/src/main/java/com/ruoyi/cai/ws/handler/message/GiftMessageHandler.java +++ b/ruoyi-cai/src/main/java/com/ruoyi/cai/ws/handler/message/GiftMessageHandler.java @@ -16,6 +16,7 @@ import com.ruoyi.cai.ws.bean.Room; import com.ruoyi.cai.ws.dto.WsRMsgGen; import com.ruoyi.cai.ws.handler.IMessageHandler; import com.ruoyi.cai.ws.handler.AbstractMessageHandle; +import com.ruoyi.common.exception.ServiceException; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -65,6 +66,10 @@ public class GiftMessageHandler extends AbstractMessageHandle implements IMessag sendToCurrent(fdCtxData,WsRMsgGen.sysNotice("赠送失败,请重试")); return; } + } catch (ServiceException e){ + log.error("直播送礼物失败!req={}", JSON.toJSONString(giveGiftReq),e); + sendToCurrent(fdCtxData,WsRMsgGen.sysNotice(e.getMessage())); + return; } catch (Exception e){ log.error("直播送礼物失败!req={}", JSON.toJSONString(giveGiftReq),e); sendToCurrent(fdCtxData,WsRMsgGen.sysNotice("赠送失败,请重试"));