Commit 3a36fa32 authored by feistel's avatar feistel
Browse files

fix: make sure ErrCafileNotFound is returned only when the file doesn't exist

parent 2b4161c1cc98
...@@ -84,7 +84,10 @@ ...@@ -84,7 +84,10 @@
} }
if _, err := os.Stat(caFile); err != nil { if _, err := os.Stat(caFile); err != nil {
return nil, fmt.Errorf("cannot find cafile '%s': %w", caFile, ErrCafileNotFound) if os.IsNotExist(err) {
return nil, fmt.Errorf("cannot find cafile '%s': %w", caFile, ErrCafileNotFound)
}
return nil, err
} }
transport, host, err = buildHttpsTransport(*hcc, selfSignedCert, gitlabURL) transport, host, err = buildHttpsTransport(*hcc, selfSignedCert, gitlabURL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment