fix(AppWriteSchemaRepairer): improve error handling and retry logic robustness

- Add null-safe error message extraction using optional chaining and fallback to error.toString()
- Ensure at least one retry attempt is made even when maxRetries is 0
- Improve _isRetryableError() to handle undefined/null errors gracefully
- Extract error code and message once to prevent repeated property access
- Fix retry attempt logging to use calculated maxAttempts instead of this.maxRetries
- Add comment clarifying that lastError is guaranteed to be set after retry loop
- Update task documentation to mark Property 7 test as PASSED and fix typo in critical error safety section
- Prevents crashes when error objects lack message property or contain unexpected error types
This commit is contained in:
2026-01-12 17:52:15 +01:00
parent 216a972fef
commit 57cb0ad0ab
4 changed files with 99 additions and 117 deletions

View File

@@ -84,6 +84,7 @@ This implementation plan creates a comprehensive system for detecting, repairing
- [x] 4.4 Write property test for error handling with instructions
- **Property 7: Error Handling with Instructions**
- **Validates: Requirements 2.3, 3.5, 6.1, 6.5**
- **Status: PASSED** (100+ iterations)
- [x] 5. Checkpoint - Core repair functionality complete
- Ensure all tests pass, ask the user if questions arise.
@@ -156,7 +157,7 @@ This implementation plan creates a comprehensive system for detecting, repairing
- [x] 7.7 Implement critical error safety mechanisms
- Add immediate process stopping for critical errors
- Provide rollback instructions
- Ensure no deletion of existing attributes or data
- no deletion of existing attributes or data
- _Requirements: 7.3, 7.4_
- [x] 7.8 Write property test for critical error safety