polysig_driver/frost/
error.rsuse thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("round {0} is not supported for this protocol")]
InvalidRound(u8),
#[error("payload for round {0} is not of the correct type")]
RoundPayload(u8),
#[error("party number is not a valid protocol identifier")]
IndexIdentifier(usize),
#[error("round {0} could not locate identifier for index {1}")]
SenderIdentifier(u8, usize),
#[error("could not locate a verifier for the message sender")]
SenderVerifier,
#[error("attempt to proceed to round 2 without round 1 data")]
Round2TooEarly,
#[error("attempt to proceed to round 3 without round 2 data")]
Round3TooEarly,
#[error(transparent)]
Protocol(#[from] polysig_protocol::Error),
#[error(transparent)]
Frost(#[from] frost_ed25519::Error),
}
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
impl From<Error> for wasm_bindgen::JsValue {
fn from(value: Error) -> Self {
let s = value.to_string();
wasm_bindgen::JsValue::from_str(&s)
}
}