ark_linear_sumcheck/
error.rs1use ark_std::fmt;
2
3use ark_std::string::String;
4use core::fmt::Formatter;
5#[derive(fmt::Debug)]
7pub enum Error {
8 Reject(Option<String>),
10 IOError,
12 SerializationError,
14 RNGError,
16 OtherError(String),
18}
19
20impl fmt::Display for Error {
21 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
22 if let Self::OtherError(s) = self {
23 f.write_str(s)
24 } else {
25 f.write_fmt(format_args!("{self:?}"))
26 }
27 }
28}
29
30impl ark_std::error::Error for Error {}
31
32impl From<ark_std::io::Error> for Error {
33 fn from(_: ark_std::io::Error) -> Self {
34 Self::IOError
35 }
36}
37
38impl From<ark_serialize::SerializationError> for Error {
39 fn from(_: ark_serialize::SerializationError) -> Self {
40 Self::SerializationError
41 }
42}
43impl From<ark_std::rand::Error> for Error {
44 fn from(_: ark_std::rand::Error) -> Self {
45 Self::RNGError
46 }
47}