Skip to content

Enhanced Error Handling#74

Merged
maxisoft merged 3 commits intomainfrom
dev
May 22, 2024
Merged

Enhanced Error Handling#74
maxisoft merged 3 commits intomainfrom
dev

Conversation

@maxisoft
Copy link
Copy Markdown
Owner

Enhanced Error Handling

What's Changed

  • Implemented a robust error handling mechanism in CommandDispatcher.cs to manage unexpected exceptions during command execution.
  • Fixed the retry mechanism with exponential backoff in RedditHelper.cs to prevent unnecessary retries within already retrying logic.
  • Centralized exception handling for Reddit JSON loading within the FreeGamesCommand.cs.
  • Modified logging behavior to provide detailed error information based on the VerboseLog setting from ASFFreeGamesOptions.

Why This Matters

These enhancements make the application more resilient and informative during errors, aiding in debugging and user experience. The fix to the retry mechanism ensures that the application does not perform redundant retries, which could lead to unnecessary load and potential rate-limiting issues.

Resolves

This pull request addresses and resolves issue #72 - Crash if Reddit request fails. The changes implemented ensure that the application handles such errors gracefully without crashing, as detailed in the issue report.

maxisoft added 3 commits May 22, 2024 11:14
This commit introduces error handling for scenarios where a Reddit request fails due to a 403 Forbidden response or other server errors. The changes fix the retry mechanism with exponential backoff and improved exception handling to ensure that the plugin does not crash and can handle Reddit server errors gracefully.
Refactored the CommandDispatcher to better handle unexpected exceptions during command execution.
The changes include a try-catch block that logs detailed information about the exception based on the VerboseLog setting in ASFFreeGamesOptions.
Moved the exception handling for Reddit JSON loading into the FreeGamesCommand to centralize error management. This change ensures that any exceptions thrown during the retrieval of games from Reddit are caught and logged appropriately, depending on the VerboseLog setting. Simplified the GetPayload method in RedditHelper by removing redundant try-catch blocks.
@maxisoft maxisoft added bug Something isn't working enhancement New feature or request labels May 22, 2024
@maxisoft maxisoft self-assigned this May 22, 2024
@maxisoft maxisoft merged commit 2185314 into main May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant