ソースを参照

Fixes: https://github.com/coreos/go-iptables/issues/35

Mark Sanborn 8 年 前
コミット
6ec148c4de
1 ファイル変更6 行追加1 行削除
  1. 6 1
      iptables/iptables.go

+ 6 - 1
iptables/iptables.go

@@ -322,7 +322,12 @@ func (ipt *IPTables) runWithOutput(args []string, stdout io.Writer) error {
 	}
 
 	if err := cmd.Run(); err != nil {
-		return &Error{*(err.(*exec.ExitError)), cmd, stderr.String()}
+		switch e := err.(type) {
+		case *exec.ExitError:
+			return &Error{*e, stderr.String()}
+		default:
+			return err
+		}
 	}
 
 	return nil