Skip to content

Commit

Permalink
Report unused parameters more usefully
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin committed Mar 22, 2014
1 parent 2ca30e6 commit 8b6357c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cbfsconfig

import (
"encoding/json"
"errors"
"fmt"
"io"
"reflect"
Expand All @@ -11,7 +10,11 @@ import (
"time"
)

var unhandledValue = errors.New("Unsupported parameter")
type unhandledValue string

func (u unhandledValue) Error() string {
return fmt.Sprintf("unhandled value: %q", string(u))
}

// Cluster-wide configuration
type CBFSConfig struct {
Expand Down Expand Up @@ -203,7 +206,7 @@ func (conf *CBFSConfig) SetParameter(name string, inval interface{}) error {
return fmt.Errorf("Unhandled type in field %v", name)
}
}
return unhandledValue
return unhandledValue(name)
}

// Dump a text representation of this config to the given writer.
Expand Down

0 comments on commit 8b6357c

Please sign in to comment.