1ecb57fda0
Explicitly handle constraint unique violation when importing credential
28 lines
673 B
Rust
28 lines
673 B
Rust
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use std::io;
|
|
use std::net::SocketAddr;
|
|
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum NymNodeHttpError {
|
|
#[error("failed to bind the HTTP API to {bind_address}: {source}")]
|
|
HttpBindFailure {
|
|
bind_address: SocketAddr,
|
|
source: io::Error,
|
|
},
|
|
|
|
#[error("failed to use nym-node requests: {source}")]
|
|
RequestError {
|
|
#[from]
|
|
source: nym_node_requests::error::Error,
|
|
},
|
|
|
|
#[error(transparent)]
|
|
KeyRecoveryError {
|
|
#[from]
|
|
source: nym_crypto::asymmetric::encryption::KeyRecoveryError,
|
|
},
|
|
}
|