Skip to main content

panproto_check/
error.rs

1//! Error types for the check crate.
2//!
3//! [`CheckError`] covers failures during schema diffing, classification,
4//! and report generation.
5
6/// Errors from breaking-change detection operations.
7#[derive(Debug, thiserror::Error)]
8#[non_exhaustive]
9pub enum CheckError {
10    /// The two schemas belong to different protocols.
11    #[error("protocol mismatch: old={old}, new={new}")]
12    ProtocolMismatch {
13        /// The old schema's protocol.
14        old: String,
15        /// The new schema's protocol.
16        new: String,
17    },
18
19    /// JSON serialization failed during report generation.
20    #[error("report serialization failed: {0}")]
21    Serialization(#[from] serde_json::Error),
22}