binius_field/
error.rs

1// Copyright 2023-2025 Irreducible Inc.
2
3/// Error thrown when a field operation fails.
4#[derive(Clone, thiserror::Error, Debug)]
5pub enum Error {
6	#[error("the argument does not match the field extension degree")]
7	ExtensionDegreeMismatch,
8	#[error("the amount of scalars in the first array is not the same as the amount of scalars in the second")]
9	MismatchedLengths,
10	#[error("the argument has too large a field extension degree")]
11	ExtensionDegreeTooHigh,
12	#[error("index {index} is out of range 0..{max}")]
13	IndexOutOfRange { index: usize, max: usize },
14	/// Thrown when trying to initialize a binary field element with a value bigger than what fits
15	/// in the binary field.
16	#[error("value is not in the field")]
17	NotInField,
18}