MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / record_error

Method record_error

core/error_database.py:191–220  ·  view source on GitHub ↗

Record an error occurrence. Args: error_type: Type of error (e.g., "ModuleNotFoundError") error_message: Full error message context: Additional context (file, line, code snippet) Returns: Error pattern key

(self, error_type: str, error_message: str,
                     context: Dict = None)

Source from the content-addressed store, hash-verified

189 return hashlib.sha256(content.encode()).hexdigest()[:16]
190
191 def record_error(self, error_type: str, error_message: str,
192 context: Dict = None) -> str:
193 """
194 Record an error occurrence.
195
196 Args:
197 error_type: Type of error (e.g., "ModuleNotFoundError")
198 error_message: Full error message
199 context: Additional context (file, line, code snippet)
200
201 Returns:
202 Error pattern key
203 """
204 key = self._generate_key(error_type, error_message)
205
206 if key in self._cache:
207 # Increment seen count
208 self._cache[key].times_seen += 1
209 else:
210 # New error pattern
211 self._cache[key] = ErrorPattern(
212 error_type=error_type,
213 error_message=error_message,
214 fix="",
215 success=False,
216 context=context or {},
217 )
218
219 self._save_database()
220 return key
221
222 def record_fix(self, error_key: str, fix: str, success: bool = True):
223 """

Callers 3

learn_from_errorMethod · 0.95
test_record_errorMethod · 0.95
test_record_fixMethod · 0.95

Calls 3

_generate_keyMethod · 0.95
_save_databaseMethod · 0.95
ErrorPatternClass · 0.85

Tested by 2

test_record_errorMethod · 0.76
test_record_fixMethod · 0.76