Browse Source

use check utl

Fabrizio (Misto) Milo 12 years ago
parent
commit
0aebf3757d
1 changed files with 3 additions and 5 deletions
  1. 3 5
      etcd.go

+ 3 - 5
etcd.go

@@ -340,15 +340,13 @@ func newCertPool(CAFile string) (tls.ClientAuthType, *x509.CertPool) {
 	if CAFile == "" {
 		return tls.NoClientCert, nil
 	}
-	pemByte, _ := ioutil.ReadFile(CAFile)
+	pemByte, err := ioutil.ReadFile(CAFile)
+	check(err)
 
 	block, pemByte := pem.Decode(pemByte)
 
 	cert, err := x509.ParseCertificate(block.Bytes)
-
-	if err != nil {
-		fatal(err)
-	}
+	check(err)
 
 	certPool := x509.NewCertPool()