b975d08342
* Set cached storage counters to 0 (#5812) * Set cached storage counters to 0 * u64 to i64 log possible error * Check addition too Debug commit Remove more data from wg storage peer Put actual ticket type in storage Simplify add peer Finish rebase Pass defguard Peer Cache less data for consumption GatewayStorage traits Wg API trait Mock test structures Unit test for peer controller EcashManager trait Init test of Authenticator Remove peer test * Fix windows different API * Use make_bincode_serializer like in other places * Add log_slow_statements to gateway storage * Use correct LevelFilter * Fix clippy * More win fix * Win clippy * Use two error variants more * Use only one Arc<RwLock<T>> instead of many more * Remove commented test * Specific trait import
38 lines
1.1 KiB
Rust
38 lines
1.1 KiB
Rust
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum GatewayStorageError {
|
|
#[error("Database experienced an internal error: {0}")]
|
|
InternalDatabaseError(#[from] sqlx::Error),
|
|
|
|
#[error("Failed to perform database migration: {0}")]
|
|
MigrationError(#[from] sqlx::migrate::MigrateError),
|
|
|
|
#[error("could not find any valid shared keys for under id {id}")]
|
|
MissingSharedKey { id: i64 },
|
|
|
|
#[error("Somehow stored data is incorrect: {0}")]
|
|
DataCorruption(String),
|
|
|
|
#[error("the stored data associated with ticket {ticket_id} is malformed!")]
|
|
MalformedStoredTicketData { ticket_id: i64 },
|
|
|
|
#[error("Failed to convert from type of database: {field_key}")]
|
|
TypeConversion { field_key: &'static str },
|
|
|
|
#[error("Serialization failure for {field_key}")]
|
|
Serialize {
|
|
field_key: &'static str,
|
|
source: bincode::Error,
|
|
},
|
|
|
|
#[error("Deserialization failure for {field_key}")]
|
|
Deserialize {
|
|
field_key: &'static str,
|
|
source: bincode::Error,
|
|
},
|
|
}
|