Skip to content

Commit d4a27cb

Browse files
committed
same but for errors
1 parent aa6277f commit d4a27cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/cert.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func runCert(_ context.Context, c *cli.Command) error {
177177

178178
certOut, err := os.Create(c.String("out"))
179179
if err != nil {
180-
return fmt.Errorf("failed to open cert.pem for writing: %w", err)
180+
return fmt.Errorf("failed to open %s for writing: %w", c.String("keyout"), err)
181181
}
182182
err = pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes})
183183
if err != nil {
@@ -191,7 +191,7 @@ func runCert(_ context.Context, c *cli.Command) error {
191191

192192
keyOut, err := os.OpenFile(c.String("keyout"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600)
193193
if err != nil {
194-
return fmt.Errorf("failed to open key.pem for writing: %w", err)
194+
return fmt.Errorf("failed to open %s for writing: %w", c.String("keyout"), err)
195195
}
196196
err = pem.Encode(keyOut, pemBlockForKey(priv))
197197
if err != nil {

0 commit comments

Comments
 (0)