Skip to content

Validation Rules and Status Codes

Andrew Paolucci edited this page Nov 23, 2026 · 1 revision

Validation Rules & Status Codes (chrome2rust)

chrome2rust reports structured diagnostic warnings across cache parsing, SQLite snapshot extraction, decryption, and MIME spoofing detection.


1. Error & Diagnostic Categories (chrome2rust-core::error)

Type / Variant Trigger Behavior
ChromeError::NotFound Missing User Data, Profile, or Cache path Fatal error on explicit CLI target; skipped cleanly during discovery.
ChromeError::InvalidFormat Truncated/corrupt Simple Cache (0xfcfb6d1ba7725c30 / 0xf4fa6f45970d41d8 trailer) or Blockfile header Emits diagnostic warning and continues scanning remaining entries.
ChromeError::Sqlite Corrupted or locked SQLite table schema (History, Cookies, Login Data, Web Data) Recorded as DiagnosticWarning without aborting sibling tables.
ChromeError::Decompress Invalid gzip, brotli, zstd, or deflate HTTP payload stream Falls back to raw payload bytes and logs warning (WarningSeverity::Warn).
ChromeError::Decrypt Missing OS keyring secret, mismatched DPAPI/AES-GCM tag, or non-matching key Emits warning; preserves encrypted ciphertext metadata safely.
MIME Mismatch Flag (mime_mismatch) Declared Content-Type header contradicts magic-byte signature in decompressed payload Flagged explicitly in CacheEntry JSON/table outputs and forensic findings.

2. Deterministic CLI Exit Codes

Exit Code Meaning
0 Success (including cache delete dry-run preview without --yes).
1 Fatal path error, invalid arguments, I/O failure, or serialization failure.
130 Graceful user cancellation via Ctrl+C (SIGINT).

Clone this wiki locally