Skip to content

Commit f63b36f

Browse files
committed
Do not anonymize the error for obj.read_object. This prevents the error from bubbling up to Terraform!
1 parent 6e5a602 commit f63b36f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

restapi/resource_api_object.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ func resourceRestApiImport(d *schema.ResourceData, meta interface{}) (imported [
116116
}
117117
log.Printf("resource_api_object.go: Import routine called. Object built:\n%s\n", obj.toString())
118118

119-
if err := obj.read_object(); err == nil {
119+
err = obj.read_object()
120+
if err == nil {
120121
set_resource_state(obj, d)
121122
/* Data that we set in the state above must be passed along
122123
as an item in the stack of imported data */
@@ -210,7 +211,8 @@ func resourceRestApiExists(d *schema.ResourceData, meta interface{}) (exists boo
210211

211212
/* Assume all errors indicate the object just doesn't exist.
212213
This may not be a good assumption... */
213-
if err := obj.read_object(); err == nil {
214+
err = obj.read_object()
215+
if err == nil {
214216
exists = true
215217
}
216218
return exists, err

0 commit comments

Comments
 (0)