Skip to content

Commit

Permalink
chore(entry_user_credential): updated error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dion-gionet committed Jun 6, 2024
1 parent 2e00e6e commit 9d3655e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions internal/provider/entry_user_credential_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ func (d *EntryUserCredentialDataSource) Read(ctx context.Context, req datasource

entryusercredential, err := d.client.Entries.UserCredential.Get(data.Id.ValueString())
if err != nil {
resp.Diagnostics.AddError("unable to read entryusercredential", err.Error())
resp.Diagnostics.AddError("unable to read user credential entry", err.Error())
return
}

entryusercredential, err = d.client.Entries.UserCredential.GetUserAuthDetails(entryusercredential)
if err != nil {
resp.Diagnostics.AddError("unable to read entryusercredential sensitive information", err.Error())
resp.Diagnostics.AddError("unable to read user credential entry sensitive information", err.Error())
return
}

Expand Down
10 changes: 5 additions & 5 deletions internal/provider/entry_user_credential_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (r *EntryUserCredentialResource) Create(ctx context.Context, req resource.C

entryusercredential, err := r.client.Entries.UserCredential.New(entryusercredential)
if err != nil {
resp.Diagnostics.AddError("unable to create entryusercredential", err.Error())
resp.Diagnostics.AddError("unable to create user credential entry", err.Error())
return
}

Expand All @@ -147,13 +147,13 @@ func (r *EntryUserCredentialResource) Read(ctx context.Context, req resource.Rea
resp.State.RemoveResource(ctx)
return
}
resp.Diagnostics.AddError("unable to read entryusercredential", err.Error())
resp.Diagnostics.AddError("unable to read user credential entry", err.Error())
return
}

entryusercredential, err = r.client.Entries.UserCredential.GetUserAuthDetails(entryusercredential)
if err != nil {
resp.Diagnostics.AddError("unable to read entryusercredential sensitive information", err.Error())
resp.Diagnostics.AddError("unable to read user credential entry sensitive information", err.Error())
return
}

Expand All @@ -175,7 +175,7 @@ func (r *EntryUserCredentialResource) Update(ctx context.Context, req resource.U

_, err := r.client.Entries.UserCredential.Update(entryusercredential)
if err != nil {
resp.Diagnostics.AddError("unable to update entryusercredential", err.Error())
resp.Diagnostics.AddError("unable to update user credential entry", err.Error())
return
}

Expand All @@ -196,7 +196,7 @@ func (r *EntryUserCredentialResource) Delete(ctx context.Context, req resource.D
resp.State.RemoveResource(ctx)
return
}
resp.Diagnostics.AddError("unable to delete entryusercredential", err.Error())
resp.Diagnostics.AddError("unable to delete user credential entry", err.Error())
return
}
}
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/entry_validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
type entryusercredentialIdValidator struct{}

func (validator entryusercredentialIdValidator) Description(_ context.Context) string {
return "entryusercredential must be a valid UUID (ex.: 00000000-0000-0000-0000-000000000000)"
return "user credential entry must be a valid UUID (ex.: 00000000-0000-0000-0000-000000000000)"
}

func (validator entryusercredentialIdValidator) MarkdownDescription(ctx context.Context) string {
Expand All @@ -26,7 +26,7 @@ func (d entryusercredentialIdValidator) ValidateString(_ context.Context, reques

_, err := uuid.Parse(id)
if err != nil {
response.Diagnostics.AddError("entryusercredential id is not a valid UUID (ex.: 00000000-0000-0000-0000-000000000000)", err.Error())
response.Diagnostics.AddError("user credential entry id is not a valid UUID (ex.: 00000000-0000-0000-0000-000000000000)", err.Error())
return
}
}

0 comments on commit 9d3655e

Please sign in to comment.