Skip to content

Commit

Permalink
Use typed error for "field not found"
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Jun 30, 2015
1 parent 7a28488 commit babc63d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tsdb/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ func (f *FieldCodec) DecodeByID(targetID uint8, b []byte) (interface{}, error) {
// expected type, and return that value.
func (f *FieldCodec) DecodeByName(name string, b []byte) (interface{}, error) {
if fi := f.fieldByName(name); fi == nil {
return 0, fmt.Errorf("field doesn't exist")
return 0, ErrFieldNotFound
} else {
return f.DecodeByID(fi.ID, b)
}
Expand Down

0 comments on commit babc63d

Please sign in to comment.