1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-29 23:39:09 -04:00

cleanup error messages

This commit is contained in:
Darien Raymond
2017-04-09 13:30:46 +02:00
parent a8586eace6
commit 7c1b3ac1f0
8 changed files with 47 additions and 47 deletions

View File

@@ -12,7 +12,7 @@ import (
)
func Dial(ctx context.Context, dest v2net.Destination) (internet.Connection, error) {
log.Trace(newError("Internet|TCP: Dailing TCP to ", dest))
log.Trace(newError("dailing TCP to ", dest))
src := internet.DialerSourceFromContext(ctx)
tcpSettings := internet.TransportSettingsFromContext(ctx).(*Config)
@@ -34,11 +34,11 @@ func Dial(ctx context.Context, dest v2net.Destination) (internet.Connection, err
if tcpSettings.HeaderSettings != nil {
headerConfig, err := tcpSettings.HeaderSettings.GetInstance()
if err != nil {
return nil, newError("Internet|TCP: Failed to get header settings.").Base(err)
return nil, newError("failed to get header settings").Base(err).AtError()
}
auth, err := internet.CreateConnectionAuthenticator(headerConfig)
if err != nil {
return nil, newError("Internet|TCP: Failed to create header authenticator.").Base(err)
return nil, newError("failed to create header authenticator").Base(err).AtError()
}
conn = auth.Client(conn)
}

View File

@@ -35,7 +35,7 @@ func ListenTCP(ctx context.Context, address v2net.Address, port v2net.Port, conn
if err != nil {
return nil, err
}
log.Trace(newError("TCP|Listener: Listening on ", address, ":", port))
log.Trace(newError("listening TCP on ", address, ":", port))
networkSettings := internet.TransportSettingsFromContext(ctx)
tcpSettings := networkSettings.(*Config)
@@ -54,11 +54,11 @@ func ListenTCP(ctx context.Context, address v2net.Address, port v2net.Port, conn
if tcpSettings.HeaderSettings != nil {
headerConfig, err := tcpSettings.HeaderSettings.GetInstance()
if err != nil {
return nil, newError("Internet|TCP: Invalid header settings.").Base(err)
return nil, newError("invalid header settings").Base(err).AtError()
}
auth, err := internet.CreateConnectionAuthenticator(headerConfig)
if err != nil {
return nil, newError("Internet|TCP: Invalid header settings.").Base(err)
return nil, newError("invalid header settings.").Base(err).AtError()
}
l.authConfig = auth
}
@@ -83,7 +83,7 @@ func (v *TCPListener) KeepAccepting() {
return nil
})
if err != nil {
log.Trace(newError("TCP|Listener: Failed to accepted raw connections: ", err).AtWarning())
log.Trace(newError("failed to accepted raw connections").Base(err).AtWarning())
continue
}