Skip to content

Commit 124d9fc

Browse files
committed
providers/atlas: make errors more readable
1 parent 4e503d1 commit 124d9fc

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

builtin/providers/atlas/resource_artifact.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,16 @@ func resourceArtifactRead(d *schema.ResourceData, meta interface{}) error {
129129
})
130130
if err != nil {
131131
return fmt.Errorf(
132-
"Error searching for artifact: %s", err)
132+
"Error searching for artifact '%s/%s': %s",
133+
user, name, err)
133134
}
134135

135136
if len(vs) == 0 {
136-
return fmt.Errorf("No matching artifact")
137+
return fmt.Errorf("No matching artifact for '%s/%s'", user, name)
137138
} else if len(vs) > 1 {
138-
return fmt.Errorf("Got %d results, only one is allowed", len(vs))
139+
return fmt.Errorf(
140+
"Got %d results for '%s/%s', only one is allowed",
141+
user, name, len(vs))
139142
}
140143
v := vs[0]
141144

0 commit comments

Comments
 (0)