Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 38b5fd8

Browse files
committedNov 6, 2023
Specific error code for failed-initialization of inventory
1 parent cc3396f commit 38b5fd8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎internal/cli/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func preRun(cmd *cobra.Command, args []string) {
150150
// initialize inventory
151151
err := inventory.Init(configuration.DataDir(configuration.Settings).String())
152152
if err != nil {
153-
feedback.Fatal(fmt.Sprintf("Error: %v", err), feedback.ErrBadArgument)
153+
feedback.Fatal(fmt.Sprintf("Error: %v", err), feedback.ErrInitializingInventory)
154154
}
155155

156156
// https://no-color.org/

‎internal/cli/feedback/errorcodes.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@ const (
4242

4343
// ErrBadArgument is returned when the arguments are not valid (7)
4444
ErrBadArgument
45+
46+
// ErrInitializingInventory is returned when the inventory cannot be initialized,
47+
// usually depends on a wrong configuration of the data dir (8)
48+
ErrInitializingInventory
4549
)

0 commit comments

Comments
 (0)
Please sign in to comment.