Skip to content

Conversation

@CalvinAllen
Copy link
Contributor

Summary

Adds error handling with rollback support to prevent leaving the solution in a broken state.

Changes

  • Wrapped entire rename operation in try-catch
  • Track state flags:
    • projectRemovedFromSolution - true after project is removed
    • projectReaddedToSolution - true after project is re-added
  • On failure:
    • Mark current step as failed in progress dialog (shows red X)
    • If project was removed but not re-added, attempt to re-add it at its current location
    • Show error message box with details
  • Removed TODO comment since all issues are now implemented

Rollback behavior

If an error occurs after the project is removed from the solution:

  1. Try to find the project file (at new path or original path)
  2. Re-add it to the solution in its original solution folder
  3. This ensures the solution isn't left without the project

Test plan

  • Rename a project successfully - should work as before
  • Simulate failure (e.g., read-only file) - should show error and attempt rollback
  • Verify failed step shows red X icon in progress dialog
  • Verify error message box appears with details

Closes #13

- Wrap rename operation in try-catch
- Track state to know if project was removed from solution
- On failure, attempt to re-add project to solution at current path
- Show failed step in progress dialog with error details
- Display error message box with explanation

Closes #13
@CalvinAllen CalvinAllen merged commit ce72894 into main Dec 20, 2025
1 check passed
@CalvinAllen CalvinAllen deleted the feat/error/handling-and-rollback branch December 20, 2025 17:03
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.

feat(error): add error handling and rollback support

2 participants