Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify err messages in check function #405

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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