File tree Expand file tree Collapse file tree
src/presentation/cli/views Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121//! # Error handling
2222//!
2323//! Text renderers always return `Ok` — they do pure string formatting and never fail.
24- //! JSON renderers call `serde_json::to_string_pretty` which is infallible on plain
25- //! `#[derive(Serialize)]` types, but the `Result` return type models the theoretical
26- //! failure path and is consistent with the `create` and `provision` commands that already
27- //! return `Result` .
24+ //! JSON renderers call `serde_json::to_string_pretty`, which is expected to succeed for
25+ //! the plain `#[derive(Serialize)]` DTOs used in this project, but serialization errors
26+ //! are still possible (e.g. non-finite floats, non-string map keys, custom `Serialize`
27+ //! impls) and are propagated as [`ViewRenderError`] .
2828
2929/// Error produced by a [`Render`] implementation.
3030///
@@ -41,7 +41,7 @@ pub enum ViewRenderError {
4141/// Trait for rendering command output data into a string.
4242///
4343/// Implementors transform a DTO (`T`) into a displayable or parseable string.
44- /// The `Result` return type is required even for infallible renderers (e.g., [`TextView`](super::commands::configure::views::text_view))
44+ /// The `Result` return type is required even for infallible renderers (e.g., [`TextView`](super::commands::configure::views::text_view::TextView ))
4545/// so that all renderers share a uniform interface and callers can use `?` unconditionally.
4646///
4747/// # Examples
You can’t perform that action at this time.
0 commit comments