forest/key_management/
errors.rs

1// Copyright 2019-2025 ChainSafe Systems
2// SPDX-License-Identifier: Apache-2.0, MIT
3
4use std::io;
5
6use thiserror::Error;
7
8#[derive(Debug, Error)]
9pub enum Error {
10    /// info that corresponds to key does not exist
11    #[error("Key info not found")]
12    KeyInfo,
13    /// Key already exists in key store
14    #[error("Key already exists")]
15    KeyExists,
16    #[error("Key does not exist")]
17    KeyNotExists,
18    #[error("Key not found")]
19    NoKey,
20    #[error(transparent)]
21    IO(#[from] io::Error),
22    #[error("{0}")]
23    Other(String),
24    #[error("Could not convert from KeyInfo to Key")]
25    KeyInfoConversion,
26}