Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 37e8bbf

Browse files
authored
Merge pull request #2721 from gophercloud/bp-v1-699db20
[v1] orchestration: Explicit error in optionsmap creation
2 parents 8a825ba + 705c648 commit 37e8bbf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

openstack/orchestration/v1/stacks/requests.go

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

33
import (
4+
"fmt"
45
"strings"
56

67
"github.com/gophercloud/gophercloud"
@@ -89,7 +90,7 @@ func (opts CreateOpts) ToStackCreateMap() (map[string]interface{}, error) {
8990
func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) {
9091
b, err := opts.ToStackCreateMap()
9192
if err != nil {
92-
r.Err = err
93+
r.Err = fmt.Errorf("error creating the options map: %w", err)
9394
return
9495
}
9596
resp, err := c.Post(createURL(c), b, &r.Body, nil)

openstack/orchestration/v1/stacks/testing/requests_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func TestCreateStackMissingRequiredInOpts(t *testing.T) {
5959
DisableRollback: gophercloud.Disabled,
6060
}
6161
r := stacks.Create(fake.ServiceClient(), createOpts)
62-
th.AssertEquals(t, "Missing input for argument [Name]", r.Err.Error())
62+
th.AssertEquals(t, "error creating the options map: Missing input for argument [Name]", r.Err.Error())
6363
}
6464

6565
func TestAdoptStack(t *testing.T) {

0 commit comments

Comments
 (0)