Files
nym/gateway/src/node/client_handling/bandwidth.rs
T
Jon Häggblad 68a192daa3 Upgrade to thiserror 2.0 (#5414)
* Upgrade to thiserror 2.0

* Remove line macros in vesting contract error type

* Name positional arguments in GatewayRequestsError

* Named positional argument

* Revert "Remove line macros in vesting contract error type"

This reverts commit 49f937da3f.

* Use positional arguments for line
2025-02-03 10:50:11 +01:00

25 lines
786 B
Rust

// Copyright 2021-2024 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: GPL-3.0-only
use std::num::ParseIntError;
use thiserror::Error;
use tracing::error;
#[derive(Debug, Error)]
pub enum BandwidthError {
#[error("Provided bandwidth credential asks for more bandwidth than it is supported to add at once (credential value: {0}, supported: {s}). Try to split it before attempting again", s = i64::MAX)]
UnsupportedBandwidthValue(u64),
#[error("failed to parse the bandwidth voucher value: {source}")]
VoucherValueParsingFailure {
#[source]
source: ParseIntError,
},
#[error("failed to parse the free pass expiry date: {source}")]
ExpiryDateParsingFailure {
#[source]
source: ParseIntError,
},
}