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:
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
|
// 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 {
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user