Skip to content

Commit ceb6d75

Browse files
committed
Return error while opening file earlier
1 parent a339ac8 commit ceb6d75

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/clientcli/create/command.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ func (c *Command) execute(ctx context.Context, cl ClientInterface) (err error) {
7373
Format: api.ArchiveFormat(c.format),
7474
BodyWriter: func(result api.DownloadResult) (io.Writer, error) {
7575
w, err := output.Open(result.Filename)
76+
if err != nil {
77+
return nil, fmt.Errorf("opening output: %w", err)
78+
}
7679

7780
if namer, ok := w.(interface{ Name() string }); ok && err == nil {
7881
log.Printf("Writing snapshot archive to %s", namer.Name())

0 commit comments

Comments
 (0)