Fix typo from a rename

pull/5572/head
Edd Robinson 2016-02-08 11:01:01 +00:00
parent db5d715846
commit b34699d222
4 changed files with 7 additions and 7 deletions

View File

@ -2,13 +2,13 @@ package graphite
import "fmt"
// An UnsupposedValueError is returned when a parsed value is not
// supposed.
type UnsupposedValueError struct {
// An UnsupportedValueError is returned when a parsed value is not
// supported.
type UnsupportedValueError struct {
Field string
Value float64
}
func (err *UnsupposedValueError) Error() string {
func (err *UnsupportedValueError) Error() string {
return fmt.Sprintf(`field "%s" value: "%v" is unsupported`, err.Field, err.Value)
}

View File

@ -119,7 +119,7 @@ func (p *Parser) Parse(line string) (models.Point, error) {
}
if math.IsNaN(v) || math.IsInf(v, 0) {
return nil, &UnsupposedValueError{Field: fields[0], Value: v}
return nil, &UnsupportedValueError{Field: fields[0], Value: v}
}
fieldValues := map[string]interface{}{}

View File

@ -229,7 +229,7 @@ func TestParseNaN(t *testing.T) {
t.Fatalf("expected error. got nil")
}
if _, ok := err.(*graphite.UnsupposedValueError); !ok {
if _, ok := err.(*graphite.UnsupportedValueError); !ok {
t.Fatalf("expected *graphite.ErrUnsupportedValue, got %v", reflect.TypeOf(err))
}
}

View File

@ -333,7 +333,7 @@ func (s *Service) handleLine(line string) {
point, err := s.parser.Parse(line)
if err != nil {
switch err := err.(type) {
case *UnsupposedValueError:
case *UnsupportedValueError:
// Graphite ignores NaN values with no error.
if math.IsNaN(err.Value) {
s.statMap.Add(statPointsNaNFail, 1)