MCPcopy Create free account
hub / github.com/concensure/Semantic / record_error

Method record_error

error_log/src/lib.rs:53–76  ·  view source on GitHub ↗

Record a new error occurrence. Returns the pattern_id.

(
        &self,
        error_kind: &str,
        message: &str,
        file_hint: Option<&str>,
        symbol_hint: Option<&str>,
    )

Source from the content-addressed store, hash-verified

51
52 /// Record a new error occurrence. Returns the pattern_id.
53 pub fn record_error(
54 &self,
55 error_kind: &str,
56 message: &str,
57 file_hint: Option<&str>,
58 symbol_hint: Option<&str>,
59 ) -> Result<i64> {
60 let normalized = normalize_message(message);
61 let hash = error_hash(error_kind, &normalized);
62 let file_stored = match self.privacy {
63 PrivacyTier::Strict => file_hint.map(hash_path).unwrap_or_default(),
64 _ => file_hint.unwrap_or("").to_string(),
65 };
66 let id = self.storage.upsert_error_pattern(
67 &hash,
68 error_kind,
69 &normalized,
70 &file_stored,
71 symbol_hint.unwrap_or(""),
72 now_ts(),
73 )?;
74 self.storage.prune_error_patterns(self.max_patterns)?;
75 Ok(id)
76 }
77
78 /// Record a solution attempt for a pattern.
79 pub fn record_solution(

Callers

nothing calls this directly

Calls 5

normalize_messageFunction · 0.85
error_hashFunction · 0.85
upsert_error_patternMethod · 0.80
prune_error_patternsMethod · 0.80
now_tsFunction · 0.70

Tested by

no test coverage detected