Skip to content

Commit

Permalink
Add proto to error
Browse files Browse the repository at this point in the history
  • Loading branch information
jrouzierinverse committed Feb 4, 2025
1 parent 3061767 commit ab88314
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions go/connector/connectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func (cc *ConnectorsContainer) ForIP(ctx context.Context, ip net.IP) *Connector
}
}
}

return cc.Get(ctx, "local_connector")
}

Expand All @@ -57,12 +58,13 @@ func OpenConnectionTo(ctx context.Context, proto string, toIP string, toPort str
c := cc.ForIP(ctx, net.ParseIP(toIP))
connInfo, err := c.DynReverse(ctx, fmt.Sprintf("%s:%s/%s", toIP, toPort, proto))
if err != nil {
return "", fmt.Errorf("unable to obtain dynreverse for %s on port %s", toIP, toPort)
return "", fmt.Errorf("unable to obtain dynreverse for %s on port %s with proto %s", toIP, toPort, proto)
}

return fmt.Sprintf("%s:%s", connInfo.Host, connInfo.Port), nil
} else {
return "", fmt.Errorf("unable to find connectors container in context")
}

return "", fmt.Errorf("unable to find connectors container in context")
}

func ConnectorsContainerFromContext(ctx context.Context) *ConnectorsContainer {
Expand Down

0 comments on commit ab88314

Please sign in to comment.