Disambiguate unsupported metrics from metrics errors
This commit is contained in:
@@ -16,8 +16,6 @@ limitations under the License.
|
||||
|
||||
package volume
|
||||
|
||||
import "errors"
|
||||
|
||||
var _ MetricsProvider = &MetricsNil{}
|
||||
|
||||
// MetricsNil represents a MetricsProvider that does not support returning
|
||||
@@ -28,5 +26,5 @@ type MetricsNil struct{}
|
||||
// GetMetrics returns an empty Metrics and an error.
|
||||
// See MetricsProvider.GetMetrics
|
||||
func (*MetricsNil) GetMetrics() (*Metrics, error) {
|
||||
return &Metrics{}, errors.New("metrics are not supported for MetricsNil Volumes")
|
||||
return &Metrics{}, NewNotSupportedError()
|
||||
}
|
||||
|
Reference in New Issue
Block a user