Improve error messages for Linux TUN and redirect operations

This commit is contained in:
世界 2026-03-15 14:43:38 +08:00
parent 82d14b26de
commit 1ab008e1e6
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
9 changed files with 98 additions and 84 deletions

View file

@ -14,13 +14,13 @@ func (r *autoRedirect) setupIPTables() error {
if r.enableIPv4 {
err := r.setupIPTablesForFamily(r.iptablesPath)
if err != nil {
return err
return E.Cause(err, "setup iptables")
}
}
if r.enableIPv6 {
err := r.setupIPTablesForFamily(r.ip6tablesPath)
if err != nil {
return err
return E.Cause(err, "setup ip6tables")
}
}
return nil