Surface blog-list errors in blogger-auth instead of an empty list

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jsahn
2026-09-01 13:39:40 +09:00
co-authored by Claude Fable 5
parent 5232631b44
commit b75bf0b887
+11 -3
View File
@@ -258,9 +258,17 @@ def cmd_blogger_auth(args: argparse.Namespace, settings: Settings) -> int:
)
blogs = blogs_resp.json().get("items", []) if blogs_resp.status_code == 200 else []
print("\n이 계정의 블로그:")
for blog in blogs:
print(f" - {blog.get('name')} id={blog.get('id')} url={blog.get('url')}")
if blogs_resp.status_code != 200:
print(
f"\n경고: 블로그 목록 조회 실패 (HTTP {blogs_resp.status_code}): {blogs_resp.text[:300]}",
file=sys.stderr,
)
elif not blogs:
print("\n경고: 이 계정에 블로그가 없습니다 - 블로그 소유 계정으로 승인했는지 확인하세요", file=sys.stderr)
else:
print("\n이 계정의 블로그:")
for blog in blogs:
print(f" - {blog.get('name')} id={blog.get('id')} url={blog.get('url')}")
blog_id = blogs[0]["id"] if len(blogs) == 1 else "<위 목록에서 선택>"
print("\n.env에 추가할 내용:\n")
print(f"BLOGGER_CLIENT_ID={client_id}")