Skip to main content

sonobe_fs/definitions/
errors.rs

1//! Error definitions for folding schemes.
2
3use ark_relations::gr1cs::SynthesisError;
4use sonobe_primitives::{
5    arithmetizations::Error as ArithError, commitments::Error as CommitmentError,
6};
7use thiserror::Error;
8
9/// [`enum@Error`] enumerates possible errors during folding scheme operations.
10#[derive(Debug, Error)]
11pub enum Error {
12    /// [`Error::ArithError`] indicates an error from the underlying constraint
13    /// system.
14    #[error(transparent)]
15    ArithError(#[from] ArithError),
16    /// [`Error::CommitmentError`] indicates an error from the underlying
17    /// commitment scheme.
18    #[error(transparent)]
19    CommitmentError(#[from] CommitmentError),
20    /// [`Error::SynthesisError`] indicates an error during constraint
21    /// synthesis.
22    #[error(transparent)]
23    SynthesisError(#[from] SynthesisError),
24    /// [`Error::Unsupported`] indicates that a certain use case is not
25    /// supported.
26    #[error("Unsupported use case: {0}")]
27    Unsupported(String),
28    /// [`Error::DomainCreationFailure`] indicates a failure in creating
29    /// evaluation domains.
30    #[error("Failed to create domain")]
31    DomainCreationFailure,
32    /// [`Error::IndivisibleByVanishingPoly`] indicates that a polynomial is
33    /// not divisible by the vanishing polynomial of a certain domain.
34    #[error("Indivisible by vanishing polynomial")]
35    IndivisibleByVanishingPoly,
36    /// [`Error::UnsatisfiedRelation`] indicates that a certain relation is not
37    /// satisfied.
38    #[error("Unsatisfied relation: {0}")]
39    UnsatisfiedRelation(String),
40    /// [`Error::InvalidPublicParameters`] indicates that the provided public
41    /// parameters are invalid.
42    #[error("Invalid public parameters: {0}")]
43    InvalidPublicParameters(String),
44}