Skip to content

Conversation

@konard
Copy link
Owner

@konard konard commented Oct 17, 2025

Summary

Fixes #18

This PR improves error handling for AbortError exceptions that occur when the VK API request times out in the setOnlineStatus trigger.

Changes

  • Enhanced error handling in triggers/set-online-status.js to specifically detect and handle AbortError
  • Added informative logging for timeout errors that distinguishes them from other errors
  • Changed error logging from console.log to console.error for non-timeout errors to improve error visibility

Technical Details

The VK API client (vk-io) uses timeouts for API requests. When a request takes too long, it throws an AbortError with type: 'aborted'. This is usually a temporary network issue.

The improved error handling:

  1. Detects AbortError by checking error.name === 'AbortError' or error.type === 'aborted'
  2. Logs a user-friendly message for timeout errors explaining that it will retry automatically
  3. Uses console.error for unexpected errors to ensure they are properly logged

Testing

The error handling logic has been reviewed to ensure:

  • AbortError exceptions are caught and logged appropriately
  • The application continues to run after timeout errors
  • The next scheduled interval will retry the operation
  • Other types of errors are still logged with full details

🤖 Generated with Claude Code

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
Fixes #18

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

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Could not set online status. AbortError: The operation was aborted. Improve error handling for AbortError in setOnlineStatus Oct 17, 2025
@konard konard marked this pull request as ready for review October 17, 2025 16:54
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 set online status. AbortError: The operation was aborted.

1 participant