1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

Bailout unknown config (#216)

* provider now checks for undecoded config entries and returns an error if any are found

* Specific error message now in server logs, more general message for user

* Changes spaces to tabs for formatting consistency

* Further formatting

* Improved handling of undecoded TOML fields in config.

* aggregator now checks for not decoded config options

Co-authored-by: Jan Höfelmeyer <Jan Höfelmeyer jhoefelmeyer@intevation.de>
Co-authored-by: Sascha L. Teichmann <sascha.teichmann@intevation.de>
This commit is contained in:
JanHoefelmeyer 2022-07-12 14:07:12 +02:00 committed by GitHub
parent cbb9c7a7a1
commit 46f79a9e24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View file

@ -47,7 +47,8 @@ func main() {
cfg, err := loadConfig()
if err != nil {
cgi.Serve(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
http.Error(rw, fmt.Sprintf("Config error: %v\n", err), http.StatusInternalServerError)
http.Error(rw, "Something went wrong. Check server logs for more details",
http.StatusInternalServerError)
}))
log.Fatalf("error: %v\n", err)
}