Disambiguate unsupported metrics from metrics errors

This commit is contained in:
Angus Salkeld
2016-09-09 11:25:09 +10:00
parent fa94308912
commit a1b2fcb10f
5 changed files with 85 additions and 16 deletions

View File

@@ -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()
}