Browse Source

feat: add error log for create endpoint

AkinoKaede 2 years ago
parent
commit
7a42380599
2 changed files with 1 additions and 5 deletions
  1. 0 2
      app/tun/handler_tcp.go
  2. 1 3
      app/tun/handler_udp.go

+ 0 - 2
app/tun/handler_tcp.go

@@ -38,8 +38,6 @@ type TCPHandler struct {
 	dispatcher    routing.Dispatcher
 	policyManager policy.Manager
 	config        *Config
-
-	stack *stack.Stack
 }
 
 func SetTCPHandler(ctx context.Context, dispatcher routing.Dispatcher, policyManager policy.Manager, config *Config) StackOption {

+ 1 - 3
app/tun/handler_udp.go

@@ -22,8 +22,6 @@ type UDPHandler struct {
 	dispatcher    routing.Dispatcher
 	policyManager policy.Manager
 	config        *Config
-
-	stack *stack.Stack
 }
 
 type udpConn struct {
@@ -41,7 +39,7 @@ func SetUDPHandler(ctx context.Context, dispatcher routing.Dispatcher, policyMan
 			wg := new(waiter.Queue)
 			linkedEndpoint, err := r.CreateEndpoint(wg)
 			if err != nil {
-				// TODO: log
+				newError("failed to create endpoint: ", err).WriteToLog(session.ExportIDToError(ctx))
 				return
 			}