bitwarden_ssh/
error.rs

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
26
27
28
29
30
31
use bitwarden_error::prelude::*;
use thiserror::Error;

#[bitwarden_error(flat)]
#[derive(Error, Debug)]
pub enum KeyGenerationError {
    #[error("Failed to generate key: {0}")]
    KeyGenerationError(ssh_key::Error),
    #[error("Failed to convert key")]
    KeyConversionError,
}

#[bitwarden_error(flat)]
#[derive(Error, Debug, PartialEq)]
pub enum SshKeyImportError {
    #[error("Failed to parse key")]
    ParsingError,
    #[error("Password required")]
    PasswordRequired,
    #[error("Wrong password")]
    WrongPassword,
    #[error("Unsupported key type")]
    UnsupportedKeyType,
}

#[bitwarden_error(flat)]
#[derive(Error, Debug, PartialEq)]
pub enum SshKeyExportError {
    #[error("Failed to convert key")]
    KeyConversionError,
}