Skip to content

Fix KeyError in get_access_token on invalid credentials#28

Open
tomasruizt wants to merge 1 commit intomainfrom
fix/access-token-error-message
Open

Fix KeyError in get_access_token on invalid credentials#28
tomasruizt wants to merge 1 commit intomainfrom
fix/access-token-error-message

Conversation

@tomasruizt
Copy link
Collaborator

@tomasruizt tomasruizt commented Mar 11, 2026

Summary

  • TikTok API can return HTTP 200 with an error JSON body (e.g. {"error": "invalid_client", ...}) instead of an access token
  • Previously this caused an opaque KeyError: 'access_token'
  • Now raises an Exception with the full response payload for easier debugging

Test plan

  • Call get_access_token() with invalid credentials and verify the error message includes the full API response

🤖 Generated with Claude Code

TikTok API can return HTTP 200 with an error JSON body (no
access_token key). Previously this caused an opaque KeyError.
Now raises an Exception with the full response payload.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tomasruizt tomasruizt self-assigned this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant