Record a fix for an error. Args: error_key: Error pattern key from record_error fix: Description of fix applied success: Whether fix resolved the issue
(self, error_key: str, fix: str, success: bool = True)
| 220 | return key |
| 221 | |
| 222 | def record_fix(self, error_key: str, fix: str, success: bool = True): |
| 223 | """ |
| 224 | Record a fix for an error. |
| 225 | |
| 226 | Args: |
| 227 | error_key: Error pattern key from record_error |
| 228 | fix: Description of fix applied |
| 229 | success: Whether fix resolved the issue |
| 230 | """ |
| 231 | if error_key not in self._cache: |
| 232 | warning(f"Error key {error_key} not found") |
| 233 | return |
| 234 | |
| 235 | pattern = self._cache[error_key] |
| 236 | pattern.fix = fix |
| 237 | pattern.success = success |
| 238 | if success: |
| 239 | pattern.times_fixed += 1 |
| 240 | |
| 241 | self._save_database() |
| 242 | info(f"Recorded fix for {pattern.error_type}: {fix[:50]}...") |
| 243 | |
| 244 | def learn_from_error(self, error_type: str, error_message: str, |
| 245 | fix: str, success: bool = True, |