Skip to main content

Module diagnostics

Module diagnostics 

Source
Expand description

Diagnosis of malformed JSON payloads fetched in CI. Split out of rmcp_release_monitor.rs to stay under the PATTERNS.md module size hard limit.

Constantsยง

JSON_PREVIEW_BYTES ๐Ÿ”’
Enough to identify what the fetch actually wrote - an ANSI escape run, an HTML error page, a GitHub API error object - without dumping a multi-hundred kilobyte payload into the CI log.

Functionsยง

diagnose_json_payload ๐Ÿ”’
Recognizes the payload shapes that actually show up when a JSON fetch goes wrong in CI, and names the fix.
escaped_head ๐Ÿ”’
Renders the first max_bytes of payload as a quoted, escaped, pure-ASCII string so control characters (notably ESC) are visible in the CI log.
json_parse_context ๐Ÿ”’
Builds the anyhow context for a failed serde_json parse of a fetched payload.