Classify errors and provide fix suggestions
(self, error_msg: str)
| 289 | } |
| 290 | |
| 291 | def classify_error(self, error_msg: str) -> Tuple[str, str, List[str]]: |
| 292 | """Classify errors and provide fix suggestions""" |
| 293 | error_type = "Unknown" |
| 294 | error_category = "general" |
| 295 | suggestions = [] |
| 296 | |
| 297 | # Extract error type |
| 298 | for err_type in self.common_fixes.keys(): |
| 299 | if err_type in error_msg: |
| 300 | error_type = err_type |
| 301 | suggestions.append(self.common_fixes[err_type]) |
| 302 | break |
| 303 | |
| 304 | # Match specific error patterns |
| 305 | for category, pattern_info in self.error_patterns.items(): |
| 306 | if re.search(pattern_info["pattern"], error_msg, re.IGNORECASE): |
| 307 | error_category = category |
| 308 | suggestions.append(pattern_info["fix"]) |
| 309 | break |
| 310 | |
| 311 | return error_type, error_category, suggestions |
| 312 | |
| 313 | def extract_error_context(self, error_msg: str) -> Dict[str, Any]: |
| 314 | """Extract error context information""" |
no outgoing calls
no test coverage detected