more error types for compute v2
diff --git a/openstack/compute/v2/extensions/volumeattach/requests.go b/openstack/compute/v2/extensions/volumeattach/requests.go
index 17cb72e..c2bc2ee 100644
--- a/openstack/compute/v2/extensions/volumeattach/requests.go
+++ b/openstack/compute/v2/extensions/volumeattach/requests.go
@@ -1,8 +1,6 @@
package volumeattach
import (
- "errors"
-
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/pagination"
)
@@ -32,7 +30,10 @@
// ToVolumeAttachmentCreateMap constructs a request body from CreateOpts.
func (opts CreateOpts) ToVolumeAttachmentCreateMap() (map[string]interface{}, error) {
if opts.VolumeID == "" {
- return nil, errors.New("Missing field required for volume attachment creation: VolumeID")
+ err := gophercloud.ErrMissingInput{}
+ err.Function = "volumeattach.ToVolumeAttachmentCreateMap"
+ err.Argument = "volumeattach.CreateOpts.VolumeID"
+ return nil, err
}
volumeAttachment := make(map[string]interface{})