Skip to content

Commit 0582db3

Browse files
committed
feat: Improve error handling in get_packages function for unsupported package types
1 parent 37705fc commit 0582db3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

services/devtools/scripts/gh-packages-cleanup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ def get_packages(org: str, package_type: Optional[str] = None, verbose: bool = T
7676
print(f"{RED}no access (missing read:packages scope){NC}")
7777
elif "404" in error:
7878
print(f"{DIM}none found{NC}")
79+
elif "422" in error or "not supported" in error.lower():
80+
print(f"{DIM}not available{NC}")
7981
else:
80-
print(f"{RED}error{NC}")
82+
# Show first line of error for debugging
83+
err_msg = error.split('\n')[0][:50] if error else "unknown"
84+
print(f"{RED}error: {err_msg}{NC}")
8185
continue
8286

8387
if output:

0 commit comments

Comments
 (0)