Skip to content

Commit

Permalink
bring back proper error message
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Nov 7, 2023
1 parent a3daf2c commit 4a1d7ec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion links/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,16 @@ func extractHostNodeInterfaceData(lb *LinkBriefRaw, specialEPIndex int) (host, h
hostData := strings.SplitN(lb.Endpoints[specialEPIndex], ":", 2)
nodeData := strings.SplitN(lb.Endpoints[nodeindex], ":", 2)

if len(hostData) != 2 || len(nodeData) != 2 {
if len(hostData) != 2 {
return "", "", "", "",
fmt.Errorf("invalid link endpoint format. expected <node>:<port>, got %s", lb.Endpoints[specialEPIndex])
}

if len(nodeData) != 2 {
return "", "", "", "",
fmt.Errorf("invalid link endpoint format. expected <node>:<port>, got %s", lb.Endpoints[nodeindex])
}

host = hostData[0]
hostIf = hostData[1]
node = nodeData[0]
Expand Down

0 comments on commit 4a1d7ec

Please sign in to comment.