git-ents.gitmain
⌘K
foforge
commit d8ec943
fix: surface acdc warnings when a check recording fails to render

check_recording_page has shown an empty terminal-view box in production with no clue why; convert_to_string silently discards acdc’s diagnostics, so a capture failure looked identical to success.

fix: log acdc’s render warnings for a check recording via stderr Assisted-by: Claude:claude-sonnet-5

Joseph D. Carpinelli · 1 month ago

Reviews

No reviews of this commit yet — record a verdict below.

Start a review

verdict

crates/git-ents-server/src/asciidoc.rs @@ -6,7 +6,9 @@ //! the *embedded* fragment (no `<!DOCTYPE>`/`<html>` frame) so it can drop //! straight into a card body styled by the page's own stylesheet. -use acdc_converters_core::{Converter, Options as ConvertOptions, inlines_to_string}; +use acdc_converters_core::{ + Converter, Diagnostics, Options as ConvertOptions, WarningSource, inlines_to_string, +}; use acdc_converters_html::{Processor, RenderOptions}; use acdc_parser::Options as ParseOptions; use maud::html; @@ -86,5 +88,15 @@ embedded: true, ..RenderOptions::default() }; - processor.convert_to_string(doc, &options).ok() + let mut output = Vec::new(); + let source = WarningSource::new("html").with_variant("recording"); + let mut warnings = Vec::new(); + let mut diagnostics = Diagnostics::new(&source, &mut warnings); + processor + .convert_to_writer(doc, &mut output, &options, &mut diagnostics) + .ok()?; + for warning in &warnings { + eprintln!("check recording render: {warning}"); + } + String::from_utf8(output).ok() }