Skip to content

Commit b51dbc5

Browse files
committed
Address remaining PR review comments
1 parent 81ebc5e commit b51dbc5

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

internal/commands/comment.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"strconv"
66

7-
"github.com/basecamp/fizzy-cli/internal/errors"
87
"github.com/basecamp/fizzy-sdk/go/pkg/generated"
98
"github.com/spf13/cobra"
109
)
@@ -152,7 +151,7 @@ var commentCreateCmd = &cobra.Command{
152151
return err
153152
}
154153
if body == "" {
155-
return errors.NewInvalidArgsError("required flag --body or --body_file or --attach not provided")
154+
return newRequiredFlagError("body, body_file, or attach")
156155
}
157156

158157
cardNumber := commentCreateCard

internal/commands/inline_attachments.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ func validateAttachmentPath(path string) error {
8686
if err != nil {
8787
return errors.NewError(fmt.Sprintf("Failed to open attachment %s: %v", path, err))
8888
}
89-
return file.Close()
89+
if err := file.Close(); err != nil {
90+
return errors.NewError(fmt.Sprintf("Failed to close attachment %s: %v", path, err))
91+
}
92+
return nil
9093
}
9194

9295
func appendAttachmentTags(content string, sgids []string) string {

0 commit comments

Comments
 (0)