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

Method extract_error_context

src/scope_refine.py:313–329  ·  view source on GitHub ↗

Extract error context information

(self, error_msg: str)

Source from the content-addressed store, hash-verified

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"""
315 context = {"line_number": None, "error_line": None, "traceback": error_msg, "specific_error": None}
316
317 # Extract line number
318 line_match = re.search(r"line (\d+)", error_msg)
319 if line_match:
320 context["line_number"] = int(line_match.group(1))
321
322 # Extract specific error information
323 lines = error_msg.split("\n")
324 for line in reversed(lines):
325 if line.strip() and not line.startswith(" "):
326 context["specific_error"] = line.strip()
327 break
328
329 return context
330
331 def validate_code_syntax(self, code: str) -> Tuple[bool, Optional[str]]:
332 """Validate code syntax correctness"""

Callers 2

generate_fix_promptMethod · 0.95
_fix_code_blockMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected