path: return error if no healthy path is available
When choosing a healthy path don't panic but return an error if no paths are available.
This affects `scion-pki certificate renew` and `scion ping`.
GitOrigin-RevId:
@@ -106,6 +106,9 @@ func Choose(
if err != nil {
return nil, serrors.WrapStr("probing paths", err)
}
+ if len(paths) == 0 {
+ return nil, serrors.New("no healthy paths available")
+ }
}
if o.interactive {
return printAndChoose(paths, remote, o.colorScheme)
