Added vSphere machine driver
Signed-off-by: Fabio Rapposelli <frapposelli@vmware.com>
This commit is contained in:
committed by
Fabio Rapposelli
parent
92dd8e01d1
commit
1bad10773c
26
drivers/vmwarevsphere/errors/datastore_error.go
Normal file
26
drivers/vmwarevsphere/errors/datastore_error.go
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License.
|
||||
*/
|
||||
|
||||
package errors
|
||||
|
||||
import "fmt"
|
||||
|
||||
type DatastoreError struct {
|
||||
datastore string
|
||||
operation string
|
||||
reason string
|
||||
}
|
||||
|
||||
func NewDatastoreError(datastore, operation, reason string) error {
|
||||
err := DatastoreError{
|
||||
datastore: datastore,
|
||||
operation: operation,
|
||||
reason: reason,
|
||||
}
|
||||
return &err
|
||||
}
|
||||
|
||||
func (err *DatastoreError) Error() string {
|
||||
return fmt.Sprintf("Unable to %s on datastore %s due to %s", err.operation, err.datastore, err.reason)
|
||||
}
|
||||
Reference in New Issue
Block a user