Skip to content

Commit

Permalink
Added CLI specific error code for failed-initialization of inventory (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Nov 6, 2023
1 parent a602844 commit c45ab20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func preRun(cmd *cobra.Command, args []string) {
// initialize inventory
err := inventory.Init(configuration.DataDir(configuration.Settings).String())
if err != nil {
feedback.Fatal(fmt.Sprintf("Error: %v", err), feedback.ErrBadArgument)
feedback.Fatal(fmt.Sprintf("Error: %v", err), feedback.ErrInitializingInventory)
}

// https://no-color.org/
Expand Down
4 changes: 4 additions & 0 deletions internal/cli/feedback/errorcodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ const (

// ErrBadTCPPortArgument is returned if the TCP port argument is not valid (9)
ErrBadTCPPortArgument

// ErrInitializingInventory is returned when the inventory cannot be initialized,
// usually depends on a wrong configuration of the data dir (10)
ErrInitializingInventory
)

0 comments on commit c45ab20

Please sign in to comment.