Skip to content

Commit

Permalink
Return error if the vault secrets app resource is not found.
Browse files Browse the repository at this point in the history
  • Loading branch information
atheken committed Oct 2, 2023
1 parent 5a3ce74 commit 79692e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/provider/resource_vault_secrets_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func (r *resourceVaultsecretsApp) Read(ctx context.Context, req resource.ReadReq
res, err := clients.GetVaultSecretsApp(ctx, r.client, loc, state.AppName.ValueString())
if err != nil {
resp.Diagnostics.AddError(err.Error(), "Unable to get app")
return
}

state.AppName = types.StringValue(res.Name)
Expand All @@ -152,6 +153,7 @@ func (r *resourceVaultsecretsApp) Update(ctx context.Context, req resource.Updat
res, err := clients.UpdateVaultSecretsApp(ctx, r.client, loc, plan.AppName.ValueString(), plan.Description.ValueString())
if err != nil {
resp.Diagnostics.AddError(err.Error(), "Unable to get app")
return
}

plan.ID = types.StringValue(res.Name)
Expand Down

0 comments on commit 79692e0

Please sign in to comment.