mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 10:42:52 +01:00
move handling of RecoverFromErrors into LoadConfig
This commit is contained in:
parent
1383190249
commit
7154f14781
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user