tweak to error message when loading configuration file

instead of saying "parsing config/mox.conf: :93: unknown key ...",
make it "parsing config/mox.conf:93: unknown key ..."
This commit is contained in:
Mechiel Lukkien 2023-06-24 10:12:25 +02:00
parent 40163bd145
commit 5baeea4746
No known key found for this signature in database

View file

@ -401,7 +401,7 @@ func ParseConfig(ctx context.Context, p string, checkOnly, doLoadTLSKeyCerts, ch
} }
defer f.Close() defer f.Close()
if err := sconf.Parse(f, &c.Static); err != nil { if err := sconf.Parse(f, &c.Static); err != nil {
return nil, []error{fmt.Errorf("parsing %s: %v", p, err)} return nil, []error{fmt.Errorf("parsing %s%v", p, err)}
} }
if xerrs := PrepareStaticConfig(ctx, p, c, checkOnly, doLoadTLSKeyCerts); len(xerrs) > 0 { if xerrs := PrepareStaticConfig(ctx, p, c, checkOnly, doLoadTLSKeyCerts); len(xerrs) > 0 {