Skip to content

Commit

Permalink
simplify err messages in check function (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris authored Oct 16, 2024
2 parents f47cb26 + 5670b61 commit 4156d21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/model/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var listCmd = &cobra.Command{

models := authorizationmodel.AuthzModelList{}
authzModels := response.AuthorizationModels
for index := range len(authzModels) {
for index := range authzModels {
authModel := authorizationmodel.AuthzModel{}
authModel.Set(authzModels[index])
models.AuthorizationModels = append(models.AuthorizationModels, authModel.DisplayAsJSON(fields))
Expand Down
4 changes: 2 additions & 2 deletions cmd/query/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func check(

response, err := fgaClient.Check(context.Background()).Body(*body).Options(*options).Execute()
if err != nil {
return nil, fmt.Errorf("failed to check due to %w", err)
return nil, err //nolint:wrapcheck
}

return response, nil
Expand Down Expand Up @@ -90,7 +90,7 @@ var checkCmd = &cobra.Command{

response, err := check(fgaClient, args[0], args[1], args[2], contextualTuples, queryContext, consistency)
if err != nil {
return fmt.Errorf("failed to check due to %w", err)
return fmt.Errorf("check failed: %w", err)
}

return output.Display(*response)
Expand Down

0 comments on commit 4156d21

Please sign in to comment.