Skip to content

Commit 8977969

Browse files
committed
Improve error messages in Import
Signed-off-by: Timo Sand <[email protected]>
1 parent a954ec1 commit 8977969

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

github/resource_github_emu_group_mapping.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package github
22

33
import (
44
"context"
5+
"fmt"
56
"net/http"
67
"strconv"
78

@@ -298,11 +299,11 @@ func resourceGithubEMUGroupMappingImport(ctx context.Context, d *schema.Resource
298299
// <group-id>:<team-slug>
299300
groupIDString, teamSlug, err := parseID2(d.Id())
300301
if err != nil {
301-
return nil, err
302+
return nil, fmt.Errorf("could not parse import ID (%s), expected format: <group-id>:<team-slug>. Parse error: %w", importID, err)
302303
}
303304
groupID, err := strconv.Atoi(groupIDString)
304305
if err != nil {
305-
return nil, err
306+
return nil, unconvertibleIdErr(groupIDString, err)
306307
}
307308

308309
tflog.Debug(ctx, "Parsed two-part import ID", map[string]any{

0 commit comments

Comments
 (0)