aerc sendmail wip

This commit is contained in:
Tim Bendt
2025-08-11 09:44:47 -05:00
parent 5eddddc8ec
commit c64fbbb072
6 changed files with 561 additions and 13 deletions

View File

@@ -81,8 +81,13 @@ def get_access_token(scopes):
token_response = app.acquire_token_by_device_flow(flow)
if token_response is None:
raise Exception("Token response is None - authentication failed")
if "access_token" not in token_response:
raise Exception("Failed to acquire token")
error_description = token_response.get("error_description", "Unknown error")
error_code = token_response.get("error", "unknown_error")
raise Exception(f"Failed to acquire token - {error_code}: {error_description}")
# Save token cache
with open(cache_file, "w") as f: