|
@@ -640,7 +640,7 @@ func (conf *Config) OperatorClasses() (map[string]*OperClass, error) {
|
640
|
640
|
lenOfLastOcs := -1
|
641
|
641
|
for {
|
642
|
642
|
if lenOfLastOcs == len(ocs) {
|
643
|
|
- return nil, ErrOperClassDependencies
|
|
643
|
+ return nil, errors.New("OperClasses contains a looping dependency, or a class extends from a class that doesn't exist")
|
644
|
644
|
}
|
645
|
645
|
lenOfLastOcs = len(ocs)
|
646
|
646
|
|
|
@@ -869,24 +869,24 @@ func LoadConfig(filename string) (config *Config, err error) {
|
869
|
869
|
config.Filename = filename
|
870
|
870
|
|
871
|
871
|
if config.Network.Name == "" {
|
872
|
|
- return nil, ErrNetworkNameMissing
|
|
872
|
+ return nil, errors.New("Network name missing")
|
873
|
873
|
}
|
874
|
874
|
if config.Server.Name == "" {
|
875
|
|
- return nil, ErrServerNameMissing
|
|
875
|
+ return nil, errors.New("Server name missing")
|
876
|
876
|
}
|
877
|
877
|
if !utils.IsServerName(config.Server.Name) {
|
878
|
|
- return nil, ErrServerNameNotHostname
|
|
878
|
+ return nil, errors.New("Server name must match the format of a hostname")
|
879
|
879
|
}
|
880
|
880
|
config.Server.nameCasefolded = strings.ToLower(config.Server.Name)
|
881
|
881
|
if config.Datastore.Path == "" {
|
882
|
|
- return nil, ErrDatastorePathMissing
|
|
882
|
+ return nil, errors.New("Datastore path missing")
|
883
|
883
|
}
|
884
|
884
|
//dan: automagically fix identlen until a few releases in the future (from now, 0.12.0), being a newly-introduced limit
|
885
|
885
|
if config.Limits.IdentLen < 1 {
|
886
|
886
|
config.Limits.IdentLen = 20
|
887
|
887
|
}
|
888
|
888
|
if config.Limits.NickLen < 1 || config.Limits.ChannelLen < 2 || config.Limits.AwayLen < 1 || config.Limits.KickLen < 1 || config.Limits.TopicLen < 1 {
|
889
|
|
- return nil, ErrLimitsAreInsane
|
|
889
|
+ return nil, errors.New("One or more limits values are too low")
|
890
|
890
|
}
|
891
|
891
|
if config.Limits.RegistrationMessages == 0 {
|
892
|
892
|
config.Limits.RegistrationMessages = 1024
|
|
@@ -999,7 +999,7 @@ func LoadConfig(filename string) (config *Config, err error) {
|
999
|
999
|
}
|
1000
|
1000
|
}
|
1001
|
1001
|
if methods["file"] && logConfig.Filename == "" {
|
1002
|
|
- return nil, ErrLoggerFilenameMissing
|
|
1002
|
+ return nil, errors.New("Logging configuration specifies 'file' method but 'filename' is empty")
|
1003
|
1003
|
}
|
1004
|
1004
|
logConfig.MethodFile = methods["file"]
|
1005
|
1005
|
logConfig.MethodStdout = methods["stdout"]
|
|
@@ -1018,7 +1018,7 @@ func LoadConfig(filename string) (config *Config, err error) {
|
1018
|
1018
|
continue
|
1019
|
1019
|
}
|
1020
|
1020
|
if typeStr == "-" {
|
1021
|
|
- return nil, ErrLoggerExcludeEmpty
|
|
1021
|
+ return nil, errors.New("Encountered logging type '-' with no type to exclude")
|
1022
|
1022
|
}
|
1023
|
1023
|
if typeStr[0] == '-' {
|
1024
|
1024
|
typeStr = typeStr[1:]
|
|
@@ -1028,7 +1028,7 @@ func LoadConfig(filename string) (config *Config, err error) {
|
1028
|
1028
|
}
|
1029
|
1029
|
}
|
1030
|
1030
|
if len(logConfig.Types) < 1 {
|
1031
|
|
- return nil, ErrLoggerHasNoTypes
|
|
1031
|
+ return nil, errors.New("Logger has no types to log")
|
1032
|
1032
|
}
|
1033
|
1033
|
|
1034
|
1034
|
newLogConfigs = append(newLogConfigs, logConfig)
|