This commit is contained in:
张良(004796)
2024-04-01 10:10:24 +08:00
parent e68467f1e9
commit f08dc9b99c

View File

@@ -16,6 +16,7 @@ import com.ruoyi.cai.ws.bean.Room;
import com.ruoyi.cai.ws.dto.WsRMsgGen; import com.ruoyi.cai.ws.dto.WsRMsgGen;
import com.ruoyi.cai.ws.handler.IMessageHandler; import com.ruoyi.cai.ws.handler.IMessageHandler;
import com.ruoyi.cai.ws.handler.AbstractMessageHandle; import com.ruoyi.cai.ws.handler.AbstractMessageHandle;
import com.ruoyi.common.exception.ServiceException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -65,6 +66,10 @@ public class GiftMessageHandler extends AbstractMessageHandle implements IMessag
sendToCurrent(fdCtxData,WsRMsgGen.sysNotice("赠送失败,请重试")); sendToCurrent(fdCtxData,WsRMsgGen.sysNotice("赠送失败,请重试"));
return; return;
} }
} catch (ServiceException e){
log.error("直播送礼物失败req={}", JSON.toJSONString(giveGiftReq),e);
sendToCurrent(fdCtxData,WsRMsgGen.sysNotice(e.getMessage()));
return;
} catch (Exception e){ } catch (Exception e){
log.error("直播送礼物失败req={}", JSON.toJSONString(giveGiftReq),e); log.error("直播送礼物失败req={}", JSON.toJSONString(giveGiftReq),e);
sendToCurrent(fdCtxData,WsRMsgGen.sysNotice("赠送失败,请重试")); sendToCurrent(fdCtxData,WsRMsgGen.sysNotice("赠送失败,请重试"));