Skip to content

Commit

Permalink
docs(resource): Improve error message when an invalid type is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
dkanney committed Feb 24, 2025
1 parent 9e35e31 commit ef5ae30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/types/scope/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package scope

import (
"context"
"fmt"

"github.com/hashicorp/boundary/globals"
"github.com/hashicorp/boundary/internal/errors"
Expand Down Expand Up @@ -62,6 +63,6 @@ func AllowedIn(ctx context.Context, r resource.Type) ([]Type, error) {
case resource.All:
return nil, errors.New(ctx, errors.InvalidParameter, op, "resource type '*' is not supported")
default:
return nil, errors.New(ctx, errors.InvalidParameter, op, "invalid resource type")
return nil, errors.New(ctx, errors.InvalidParameter, op, fmt.Sprintf("invalid resource type: %d", r))
}
}

0 comments on commit ef5ae30

Please sign in to comment.