mirror of
https://github.com/lyx0/yaf.git
synced 2024-11-13 19:49:53 +01:00
ref: error out on unknown config keys
This commit is contained in:
parent
b3f6b5a590
commit
7985419e1e
2 changed files with 4 additions and 2 deletions
|
@ -6,6 +6,8 @@ import (
|
|||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/go-errors/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -142,7 +144,7 @@ func ConfigFromFile(filePath string) (*Config, error) {
|
|||
|
||||
retval.ExifAbortOnError = parsed
|
||||
default:
|
||||
log.Printf("unexpected key: \"%s\", ignoring\n", key)
|
||||
return nil, errors.Errorf("unexpected config key: \"%s\"", key)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
jaf.go
2
jaf.go
|
@ -37,7 +37,7 @@ func main() {
|
|||
// Read config
|
||||
config, err := ConfigFromFile(params.configFile)
|
||||
if err != nil {
|
||||
log.Fatalf("could not read config file: %s\n", err.Error())
|
||||
log.Fatalf("could not parse config file: %s\n", err.Error())
|
||||
}
|
||||
|
||||
handler := uploadHandler{
|
||||
|
|
Loading…
Reference in a new issue