hyperplonk/arithmetic/src/errors.rs
arithmetic/src/errors.rsRaw
1// Copyright (c) 2023 Espresso Systems (espressosys.com)
2// This file is part of the HyperPlonk library.
3
4// You should have received a copy of the MIT License
5// along with the HyperPlonk library. If not, see <https://mit-license.org/>.
6
7//! Error module.
8
9use ark_std::string::String;
10use displaydoc::Display;
11
12/// A `enum` specifying the possible failure modes of the arithmetics.
13#[derive(Display, Debug)]
14pub enum ArithErrors {
15 /// Invalid parameters: {0}
16 InvalidParameters(String),
17 /// Should not arrive to this point
18 ShouldNotArrive,
19 /// An error during (de)serialization: {0}
20 SerializationErrors(ark_serialize::SerializationError),
21}
22
23impl From<ark_serialize::SerializationError> for ArithErrors {
24 fn from(e: ark_serialize::SerializationError) -> Self {
25 Self::SerializationErrors(e)
26 }
27}