Record a new error occurrence. Returns the pattern_id.
(
&self,
error_kind: &str,
message: &str,
file_hint: Option<&str>,
symbol_hint: Option<&str>,
)
| 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( |
nothing calls this directly
no test coverage detected