Skip to content

Commit

Permalink
Merge pull request #107 from danwinship/IsNotExist
Browse files Browse the repository at this point in the history
Add another pattern to IsNotExist
  • Loading branch information
squeed authored Jul 31, 2023
2 parents fa6abe8 + b299a5b commit 5dc28b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion iptables/iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5dc28b7

Please sign in to comment.