fix: UPF抓包错误捕获
This commit is contained in:
@@ -243,6 +243,14 @@ func (s *TcpdumpController) NeUPFTask(c *gin.Context) {
|
|||||||
c.JSON(200, result.ErrMsg(err.Error()))
|
c.JSON(200, result.ErrMsg(err.Error()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if strings.Contains(msg, "command not found") {
|
||||||
|
c.JSON(200, result.ErrMsg("Command [expect] Not Found"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if strings.Contains(msg, "Unable to connect to remote host") {
|
||||||
|
c.JSON(200, result.ErrMsg("Connection Refused"))
|
||||||
|
return
|
||||||
|
}
|
||||||
s := strings.Index(msg, "pcap dispatch trace:")
|
s := strings.Index(msg, "pcap dispatch trace:")
|
||||||
if s == -1 {
|
if s == -1 {
|
||||||
s = strings.Index(msg, "Write ")
|
s = strings.Index(msg, "Write ")
|
||||||
|
|||||||
Reference in New Issue
Block a user