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(
9		"the amount of scalars in the first array is not the same as the amount of scalars in the second"
10	)]
11	MismatchedLengths,
12	#[error("the argument has too large a field extension degree")]
13	ExtensionDegreeTooHigh,
14	#[error("index {index} is out of range 0..{max}")]
15	IndexOutOfRange { index: usize, max: usize },
16	/// Thrown when trying to initialize a binary field element with a value bigger than what fits
17	/// in the binary field.
18	#[error("value is not in the field")]
19	NotInField,
20}