3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 11:59:40 +01:00

move handling of RecoverFromErrors into LoadConfig

This commit is contained in:
Shivaram Lingamneni 2018-07-16 04:08:24 -04:00
parent 1383190249
commit 7154f14781
2 changed files with 7 additions and 3 deletions

View File

@ -686,6 +686,12 @@ func LoadConfig(filename string) (config *Config, err error) {
}
}
// RecoverFromErrors defaults to true
if config.Debug.RecoverFromErrors == nil {
config.Debug.RecoverFromErrors = new(bool)
*config.Debug.RecoverFromErrors = true
}
// casefold/validate server name
config.Server.nameCasefolded, err = Casefold(config.Server.Name)
if err != nil {

View File

@ -29,9 +29,7 @@ func (server *Server) Password() []byte {
}
func (server *Server) RecoverFromErrors() bool {
// default to true if unset
rfe := server.Config().Debug.RecoverFromErrors
return rfe == nil || *rfe
return *server.Config().Debug.RecoverFromErrors
}
func (server *Server) ProxyAllowedFrom() []string {