Skip to main content

binius_iop/basefold/
error.rs

1// Copyright 2025 Irreducible Inc.
2// Copyright 2026 The Binius Developers
3
4use crate::fri;
5
6#[derive(Debug, thiserror::Error)]
7pub enum Error {
8	#[error("FRI: {0}")]
9	FRI(#[source] fri::Error),
10	#[error("IP channel: {0}")]
11	IPChannel(#[from] binius_ip::channel::Error),
12	#[error("verification error: {0}")]
13	Verification(#[from] VerificationError),
14}
15
16#[derive(Debug, thiserror::Error)]
17pub enum VerificationError {
18	#[error("FRI: {0}")]
19	FRI(#[from] fri::VerificationError),
20}
21
22impl From<fri::Error> for Error {
23	fn from(err: fri::Error) -> Self {
24		match err {
25			fri::Error::Verification(err) => Error::Verification(err.into()),
26			_ => Error::FRI(err),
27		}
28	}
29}