/
errors.go
38 lines (31 loc) · 1.02 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package portworx
import (
"fmt"
)
// ErrFailedToInspectVolume error type for failing to inspect a volume
type ErrFailedToInspectVolume struct {
// ID is the ID/name of the volume that failed to inspect
ID string
// Cause is the underlying cause of the error
Cause string
}
func (e *ErrFailedToInspectVolume) Error() string {
return fmt.Sprintf("Failed to inspect volume: %v due to err: %v", e.ID, e.Cause)
}
// ErrFailedToGetNodes error type for failing to get the nodes where a driver
// is available
type ErrFailedToGetNodes struct {
// Cause is the underlying cause of the error
Cause string
}
func (e *ErrFailedToGetNodes) Error() string {
return fmt.Sprintf("Failed to get nodes for the driver: %v", e.Cause)
}
// ErrFailedToGetClusterID error type for failing to get the clusterID for a driver
type ErrFailedToGetClusterID struct {
// Cause is the underlying cause of the error
Cause string
}
func (e *ErrFailedToGetClusterID) Error() string {
return fmt.Sprintf("Failed to get clusterID for the driver: %v", e.Cause)
}