Skip to content

Commit

Permalink
Error appropriate for edge case (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmarcotrigiano authored Nov 5, 2024
1 parent 51c8e6f commit f9a9ac4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2471,7 +2471,9 @@ func (g *GoCloak) GetAvailableRealmRolesByGroupID(ctx context.Context, token, re
// GetRealm returns top-level representation of the realm
func (g *GoCloak) GetRealm(ctx context.Context, token, realm string) (*RealmRepresentation, error) {
const errMessage = "could not get realm"

if realm == "" {
return nil, errors.New("realm is empty")
}
var result RealmRepresentation
resp, err := g.GetRequestWithBearerAuth(ctx, token).
SetResult(&result).
Expand Down

0 comments on commit f9a9ac4

Please sign in to comment.