mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 06:42:09 +08:00
Config: Add configuration option to define custom user-facing general error message for certain error types (#70023)
--------- Co-authored-by: Summer Wollin <summer.wollin@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
This commit is contained in:
@ -537,6 +537,9 @@ type Cfg struct {
|
||||
|
||||
CustomResponseHeaders map[string]string
|
||||
|
||||
// This is used to override the general error message shown to users when we want to obfuscate a sensitive backend error
|
||||
UserFacingDefaultError string
|
||||
|
||||
// DatabaseInstrumentQueries is used to decide if database queries
|
||||
// should be instrumented with metrics, logs and traces.
|
||||
// This needs to be on the global object since its used in the
|
||||
@ -1224,6 +1227,9 @@ func (cfg *Cfg) Load(args CommandLineArgs) error {
|
||||
databaseSection := iniFile.Section("database")
|
||||
cfg.DatabaseInstrumentQueries = databaseSection.Key("instrument_queries").MustBool(false)
|
||||
|
||||
logSection := iniFile.Section("log")
|
||||
cfg.UserFacingDefaultError = logSection.Key("user_facing_default_error").MustString("please inspect Grafana server log for details")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user