Skip to content

Commit

Permalink
feat(cli): return error if key doesn't exist
Browse files Browse the repository at this point in the history
imiric committed Apr 16, 2024
1 parent e60adad commit 823e7fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/cli/get.go
Original file line number Diff line number Diff line change
@@ -56,9 +56,11 @@ func (c *Get) Run(appCtx *actx.Context) error {
}
}

if ok {
fmt.Fprintf(appCtx.Stdout, "%s", value)
if !ok {
return fmt.Errorf("key '%s' doesn't exist in the '%s' namespace", c.Key, c.Namespace)
}

fmt.Fprintf(appCtx.Stdout, "%v", value)

return nil
}

0 comments on commit 823e7fe

Please sign in to comment.