Procházet zdrojové kódy

Merge pull request #107 from danwinship/IsNotExist

Add another pattern to IsNotExist
Casey Callendrello před 1 rokem
rodič
revize
5dc28b746f
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      iptables/iptables.go

+ 2 - 1
iptables/iptables.go

@@ -52,7 +52,8 @@ func (e *Error) IsNotExist() bool {
 	}
 	msgNoRuleExist := "Bad rule (does a matching rule exist in that chain?).\n"
 	msgNoChainExist := "No chain/target/match by that name.\n"
-	return strings.Contains(e.msg, msgNoRuleExist) || strings.Contains(e.msg, msgNoChainExist)
+	msgENOENT := "No such file or directory"
+	return strings.Contains(e.msg, msgNoRuleExist) || strings.Contains(e.msg, msgNoChainExist) || strings.Contains(e.msg, msgENOENT)
 }
 
 // Protocol to differentiate between IPv4 and IPv6