Skip to content

Commit b7c9f3c

Browse files
committed
fix error management
1 parent 3314ff6 commit b7c9f3c

File tree

13 files changed

+31
-32
lines changed

13 files changed

+31
-32
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-aggregator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-aggregator"
3-
version = "0.2.38"
3+
version = "0.2.39"
44
description = "A Mithril Aggregator server"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-aggregator/tests/test_extensions/runtime_tester.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl RuntimeTester {
250250
signers: &[SignerFixture],
251251
) -> Result<(), String> {
252252
let lock = self.deps_builder.get_multi_signer().await.unwrap();
253-
let mut multisigner = lock.write().await;
253+
let multisigner = lock.read().await;
254254
let message = multisigner
255255
.get_current_message()
256256
.await

mithril-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-client"
3-
version = "0.2.14"
3+
version = "0.2.15"
44
description = "A Mithril Client"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-client/src/commands/download.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use std::{error::Error, fmt::Display, sync::Arc};
1+
use std::{fmt::Display, sync::Arc};
22

33
use clap::Parser;
44
use config::{builder::DefaultState, ConfigBuilder};
5-
use mithril_common::api_version::APIVersionProvider;
5+
use mithril_common::{api_version::APIVersionProvider, StdError};
66
use serde::Serialize;
77
use slog_scope::debug;
88

@@ -28,7 +28,7 @@ impl DownloadCommand {
2828
pub async fn execute(
2929
&self,
3030
config_builder: ConfigBuilder<DefaultState>,
31-
) -> Result<(), Box<dyn Error>> {
31+
) -> Result<(), StdError> {
3232
debug!("Download snapshots");
3333
let config: Config = config_builder
3434
.build()

mithril-client/src/commands/list.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use std::{error::Error, sync::Arc};
1+
use std::sync::Arc;
22

33
use clap::Parser;
44
use cli_table::{print_stdout, WithTitle};
55
use config::{builder::DefaultState, ConfigBuilder};
6-
use mithril_common::api_version::APIVersionProvider;
6+
use mithril_common::{api_version::APIVersionProvider, StdError};
77
use slog_scope::debug;
88

99
use crate::{AggregatorHTTPClient, Config, Runtime};
@@ -21,7 +21,7 @@ impl ListCommand {
2121
pub async fn execute(
2222
&self,
2323
config_builder: ConfigBuilder<DefaultState>,
24-
) -> Result<(), Box<dyn Error>> {
24+
) -> Result<(), StdError> {
2525
debug!("List snapshots");
2626
let config: Config = config_builder
2727
.build()

mithril-client/src/commands/restore.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ use mithril_common::{
99
cache::ImmutableFileDigestCacheProvider,
1010
cache::JsonImmutableFileDigestCacheProviderBuilder, CardanoImmutableDigester,
1111
},
12+
StdError,
1213
};
1314
use slog_scope::{debug, warn};
14-
use std::{error::Error, path::Path, sync::Arc};
15+
use std::{path::Path, sync::Arc};
1516

1617
use crate::{AggregatorHTTPClient, AggregatorHandler, Config, Runtime};
1718

@@ -41,7 +42,7 @@ impl RestoreCommand {
4142
pub async fn execute(
4243
&self,
4344
config_builder: ConfigBuilder<DefaultState>,
44-
) -> Result<(), Box<dyn Error>> {
45+
) -> Result<(), StdError> {
4546
debug!("Restore snapshot");
4647
let config: Config = config_builder
4748
.build()
@@ -102,7 +103,7 @@ async fn build_digester_cache_provider(
102103
disable_digests_cache: bool,
103104
reset_digests_cache: bool,
104105
config: &Config,
105-
) -> Result<Option<Arc<dyn ImmutableFileDigestCacheProvider>>, Box<dyn Error>> {
106+
) -> Result<Option<Arc<dyn ImmutableFileDigestCacheProvider>>, StdError> {
106107
if disable_digests_cache {
107108
return Ok(None);
108109
}

mithril-client/src/commands/show.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use std::{error::Error, sync::Arc};
1+
use std::sync::Arc;
22

33
use clap::Parser;
44
use cli_table::{print_stdout, WithTitle};
55
use config::{builder::DefaultState, ConfigBuilder};
6-
use mithril_common::api_version::APIVersionProvider;
6+
use mithril_common::{api_version::APIVersionProvider, StdError};
77
use slog_scope::debug;
88

99
use crate::{convert_to_field_items, AggregatorHTTPClient, Config, Runtime};
@@ -24,7 +24,7 @@ impl ShowCommand {
2424
pub async fn execute(
2525
&self,
2626
config_builder: ConfigBuilder<DefaultState>,
27-
) -> Result<(), Box<dyn Error>> {
27+
) -> Result<(), StdError> {
2828
debug!("Show snapshot");
2929
let config: Config = config_builder
3030
.build()

mithril-client/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
use clap::{Parser, Subcommand};
44
use config::builder::DefaultState;
55
use config::{ConfigBuilder, Map, Source, Value, ValueKind};
6+
use mithril_common::StdError;
67
use slog::{Drain, Level, Logger};
78
use slog_scope::debug;
8-
use std::error::Error;
99
use std::path::PathBuf;
1010
use std::sync::Arc;
1111

@@ -42,7 +42,7 @@ pub struct Args {
4242
}
4343

4444
impl Args {
45-
pub async fn execute(&self) -> Result<(), Box<dyn Error>> {
45+
pub async fn execute(&self) -> Result<(), StdError> {
4646
debug!("Run Mode: {}", self.run_mode);
4747
let config: ConfigBuilder<DefaultState> = config::Config::builder()
4848
.add_source(
@@ -122,7 +122,7 @@ impl Commands {
122122
pub async fn execute(
123123
&self,
124124
config_builder: ConfigBuilder<DefaultState>,
125-
) -> Result<(), Box<dyn Error>> {
125+
) -> Result<(), StdError> {
126126
match self {
127127
Self::List(cmd) => cmd.execute(config_builder).await,
128128
Self::Download(cmd) => cmd.execute(config_builder).await,

mithril-common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-common"
3-
version = "0.2.33"
3+
version = "0.2.34"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
documentation = { workspace = true }

0 commit comments

Comments
 (0)