Skip to content

Commit

Permalink
Add error log in case role retrieval fails
Browse files Browse the repository at this point in the history
  • Loading branch information
emerkle826 committed May 12, 2022
1 parent 0fa8312 commit 2bb6c0f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/provider/data_source_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ func listRole(ctx context.Context, client *astra.ClientWithResponses, roleID str
return nil, err
}

if resp.StatusCode() > 200 {
return nil, fmt.Errorf("Fetching role \"%s\" was not successful. Message: %s", roleID, string(resp.Body))
}
roleRaw := (*resp.JSON200).(map[string]interface{})

return roleRaw, err
Expand Down

0 comments on commit 2bb6c0f

Please sign in to comment.