Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c45ab20

Browse files
authored
Added CLI specific error code for failed-initialization of inventory (#2402)
1 parent a602844 commit c45ab20

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
@@ -49,4 +49,8 @@ const (
4949

5050
// ErrBadTCPPortArgument is returned if the TCP port argument is not valid (9)
5151
ErrBadTCPPortArgument
52+
53+
// ErrInitializingInventory is returned when the inventory cannot be initialized,
54+
// usually depends on a wrong configuration of the data dir (10)
55+
ErrInitializingInventory
5256
)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /