Skip to content

Commit 958c46d

Browse files
authored
fix(account): project data source project not found (#1915)
1 parent ad8b153 commit 958c46d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scaleway/data_source_account_project.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package scaleway
22

33
import (
44
"context"
5+
"fmt"
56

67
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
78
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -55,7 +56,11 @@ func dataSourceScalewayAccountProjectRead(ctx context.Context, d *schema.Resourc
5556
}
5657
}
5758
if projectID == "" {
58-
diag.Errorf("no project found with the name %s", d.Get("name"))
59+
return diag.Diagnostics{{
60+
Severity: diag.Error,
61+
Summary: fmt.Sprintf("no project found with the name %s", d.Get("name")),
62+
Detail: "API Keys must be from the same organization as the project to fetch it",
63+
}}
5964
}
6065
} else {
6166
extractedProjectID, _, err := extractProjectID(d, meta.(*Meta))

0 commit comments

Comments
 (0)