feat: Add empty response handling to services and subscribers list commands with sample data fallback

- Update listServices to check for empty services slice in addition to error condition
- Update listSubscribers to check for empty subscribers slice in addition to error condition
- Add muted message when API returns empty results but no error
- Preserve existing warning message when API returns error
- Show sample/placeholder data in both empty and error cases
This commit is contained in:
nutcas3
2026-04-17 16:30:23 +03:00
parent a32b933fbf
commit 3ac8a1a08e
2 changed files with 12 additions and 4 deletions
+6 -2
View File
@@ -52,8 +52,12 @@ func listSubscribers(u *uiContext) error {
u.header("Active Subscribers")
subs, err := u.client.ListSubscribers()
if err != nil {
u.warn("Using placeholder data: " + err.Error())
if err != nil || len(subs) == 0 {
if err != nil {
u.warn("Using placeholder data: " + err.Error())
} else {
u.muted("(API returned no subscribers - showing sample data)")
}
t := u.newTable()
t.AddColumn("IMSI", 16, "left")
t.AddColumn("Name", 22, "left")