More user-friendly warning about non-existing module of rpc #4568

This commit is contained in:
Alex Sharov 2022-06-29 08:24:57 +06:00 committed by GitHub
parent aa7985341e
commit 6878ddb76f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -465,7 +465,7 @@ func newGzipHandler(next http.Handler) http.Handler {
// and then registers all of the APIs exposed by the services. // and then registers all of the APIs exposed by the services.
func RegisterApisFromWhitelist(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error { func RegisterApisFromWhitelist(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error {
if bad, available := checkModuleAvailability(modules, apis); len(bad) > 0 { if bad, available := checkModuleAvailability(modules, apis); len(bad) > 0 {
log.Error("Unavailable modules in HTTP API list", "unavailable", bad, "available", available) log.Error("Non-existing modules in HTTP API list, please remove it", "non-existing", bad, "existing", available)
} }
// Generate the whitelist based on the allowed modules // Generate the whitelist based on the allowed modules
whitelist := make(map[string]bool) whitelist := make(map[string]bool)