1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use std::fmt::{self, Display};

#[derive(Copy, PartialEq, Eq, Clone, Debug)]
pub enum Error {
  InvalidKey,
  InvalidSS,
  InvalidCom,
  InvalidSig,
  Phase5BadSum,
  Phase6Error,
}

#[derive(Clone, Debug)]
pub struct ErrorType {
  pub error_type: String,
  pub bad_actors: Vec<usize>,
}

impl Display for Error {
  fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
    write!(f, "{:?}", &self)
  }
}

impl std::error::Error for Error {}