Skip to content

Commit

Permalink
Add diagnostics and return if error
Browse files Browse the repository at this point in the history
  • Loading branch information
freimer committed Oct 12, 2022
1 parent c764627 commit 965e5d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions airplanedev/environment_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func (d *environmentDataSource) Read(ctx context.Context, req datasource.ReadReq
// Retrieve values from config
var slug string
diags := req.Config.GetAttribute(ctx, path.Root("slug"), &slug)
resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
return
}
env, err := d.client.GetEnv(ctx, slug)
if err != nil {
resp.Diagnostics.AddError(
Expand Down

0 comments on commit 965e5d2

Please sign in to comment.