3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +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 // casefold/validate server name
config.Server.nameCasefolded, err = Casefold(config.Server.Name) config.Server.nameCasefolded, err = Casefold(config.Server.Name)
if err != nil { if err != nil {

View File

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