Skip to content

Automation: Unify exception handling in AppControl and AppCleaner#1808

Merged
d4rken merged 1 commit into
mainfrom
acs-1-catch
May 26, 2025
Merged

Automation: Unify exception handling in AppControl and AppCleaner#1808
d4rken merged 1 commit into
mainfrom
acs-1-catch

Conversation

@d4rken

@d4rken d4rken commented May 26, 2025

Copy link
Copy Markdown
Member

This change refactors the exception handling logic in AppControlAutomation.kt and ClearCacheModule.kt to use a when statement for better readability and consistency.

Key changes:

  • Replaced multiple catch blocks with a single catch (e: Exception) block.
  • Used a when statement within the catch block to handle different exception types.
  • Ensured consistent logging and error reporting across both modules.
  • Maintained existing logic for specific exceptions like AutomationTimeoutException, UserCancelledAutomationException, and PlanAbortException.
  • Re-throw unhandled critical exceptions like InvalidSystemStateException, AutomationOverlayException, and UnsupportedOperationException after logging.

This change refactors the exception handling logic in `AppControlAutomation.kt` and `ClearCacheModule.kt` to use a `when` statement for better readability and consistency.

Key changes:
- Replaced multiple `catch` blocks with a single `catch (e: Exception)` block.
- Used a `when` statement within the `catch` block to handle different exception types.
- Ensured consistent logging and error reporting across both modules.
- Maintained existing logic for specific exceptions like `AutomationTimeoutException`, `UserCancelledAutomationException`, and `PlanAbortException`.
- Re-throw unhandled critical exceptions like `InvalidSystemStateException`, `AutomationOverlayException`, and `UnsupportedOperationException` after logging.
@d4rken d4rken added the Automation Accessibility service related (ACS) label May 26, 2025
@d4rken d4rken merged commit 2fc4aea into main May 26, 2025
@d4rken d4rken deleted the acs-1-catch branch May 26, 2025 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Automation Accessibility service related (ACS)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant