MCPcopy Create free account
hub / github.com/showlab/Code2Video / classify_error

Method classify_error

src/scope_refine.py:291–311  ·  view source on GitHub ↗

Classify errors and provide fix suggestions

(self, error_msg: str)

Source from the content-addressed store, hash-verified

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"""

Callers 2

generate_fix_promptMethod · 0.95
_fix_code_blockMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected