rename Error to Err

This commit is contained in:
v2ray committed 2016-06-27 08:53:35 +02:00
1 parent 5ee87404fd
commit 7f661f5215
41 files changed
+118 -118

No files matched your search

+2 -2
View File
@@ -9,7 +9,7 @@ type ConfigObjectCreator func([]byte) (interface{}, error)
var (
configCache map[string]ConfigObjectCreator
ErrorRouterNotFound = errors.New("Router not found.")
ErrRouterNotFound = errors.New("Router not found.")
)
func RegisterRouterConfig(strategy string, creator ConfigObjectCreator) error {
@@ -21,7 +21,7 @@ func RegisterRouterConfig(strategy string, creator ConfigObjectCreator) error {
func CreateRouterConfig(strategy string, data []byte) (interface{}, error) {
creator, found := configCache[strategy]
if !found {
return nil, ErrorRouterNotFound
return nil, ErrRouterNotFound
}
return creator(data)
}
+1 -1
View File
@@ -33,5 +33,5 @@ func CreateRouter(name string, rawConfig interface{}, space app.Space) (Router,
if factory, found := routerCache[name]; found {
return factory.Create(rawConfig, space)
}
return nil, ErrorRouterNotFound
return nil, ErrRouterNotFound
}
+4 -4
View File
@@ -11,8 +11,8 @@ import (
)
var (
ErrorInvalidRule = errors.New("Invalid Rule")
ErrorNoRuleApplicable = errors.New("No rule applicable")
ErrInvalidRule = errors.New("Invalid Rule")
ErrNoRuleApplicable = errors.New("No rule applicable")
)
type Router struct {
@@ -29,7 +29,7 @@ func NewRouter(config *RouterRuleConfig, space app.Space) *Router {
space.InitializeApplication(func() error {
if !space.HasApp(dns.APP_ID) {
log.Error("DNS: Router is not found in the space.")
return app.ErrorMissingApplication
return app.ErrMissingApplication
}
r.dnsServer = space.GetApp(dns.APP_ID).(dns.Server)
return nil
@@ -79,7 +79,7 @@ func (this *Router) takeDetourWithoutCache(dest v2net.Destination) (string, erro
}
}
return "", ErrorNoRuleApplicable
return "", ErrNoRuleApplicable
}
func (this *Router) TakeDetour(dest v2net.Destination) (string, error) {