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"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/go-errors/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -142,7 +144,7 @@ func ConfigFromFile(filePath string) (*Config, error) {
|
||||||
|
|
||||||
retval.ExifAbortOnError = parsed
|
retval.ExifAbortOnError = parsed
|
||||||
default:
|
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
|
// Read config
|
||||||
config, err := ConfigFromFile(params.configFile)
|
config, err := ConfigFromFile(params.configFile)
|
||||||
if err != nil {
|
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{
|
handler := uploadHandler{
|
||||||
|
|
Loading…
Reference in a new issue