Skip to content

Commit

Permalink
add PeeringDB check
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Oct 31, 2020
1 parent b2ca5ec commit 9da4bb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ func getPeeringDbData(asn uint32) PeeringDbData {
log.Fatalf("PeeringDB JSON Unmarshal: %v", err)
}

if len(peeringDbResponse.Data) < 1 {
log.Fatalf("Peer %d doesn't have a valid PeeringDB entry. Try import-valid or ask the network to update their account.", asn)
}

return peeringDbResponse.Data[0] // TODO: Add a check here
}

Expand Down

0 comments on commit 9da4bb5

Please sign in to comment.