Skip to content

Fix invalid access_token error handling in execute.sh#33

Open
konard wants to merge 3 commits intomainfrom
issue-22-7d537d4d
Open

Fix invalid access_token error handling in execute.sh#33
konard wants to merge 3 commits intomainfrom
issue-22-7d537d4d

Conversation

@konard
Copy link
Copy Markdown
Owner

@konard konard commented Oct 17, 2025

The script was failing with repeated error messages:
APIError: Code №5 - User authorization failed: invalid access_token (4).

The issue occurred because execute.sh was missing handling for the "User authorization failed: invalid access_token." error message variant. The script only handled other token-related errors (expired, wrong IP, no token), but not this specific invalid token error.

Changes Made

  • Added TOKEN_INVALID_ERROR_MESSAGE constant to execute.sh
  • Updated the error checking condition to include this new error message
  • Now the script will properly regenerate the access token when this error occurs

Bug Fixes

This also addresses the "too many requests" bug mentioned in the issue. Previously, when the invalid token error occurred, the script would continue making failed requests in a loop. Now it will properly catch the error and regenerate the token, preventing the spam of error messages.

Fixes #22

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: undefined
@konard konard self-assigned this Oct 17, 2025
This commit fixes issue #22 where the application was failing with:
"APIError: Code №5 - User authorization failed: invalid access_token (4)."

The execute.sh script now includes TOKEN_INVALID_ERROR_MESSAGE to handle
the "User authorization failed: invalid access_token." error message, which
was previously not caught by the existing error handlers.

This also addresses the "too many requests" bug mentioned in the issue,
as the script will now properly regenerate the token instead of
continuously failing with the same error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Could not retrieve friends to delete deactivated ones: APIError: Code №5 - User authorization failed: invalid access_token (4). Fix invalid access_token error handling in execute.sh Oct 17, 2025
@konard konard marked this pull request as ready for review October 17, 2025 16:29
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.

Could not retrieve friends to delete deactivated ones: APIError: Code №5 - User authorization failed: invalid access_token (4).

1 participant