mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
cli_helpers: use anyhow in app fn; aquatic_ws: reorganize error handling
This commit is contained in:
parent
1efe6f96c5
commit
526faa9aab
13 changed files with 134 additions and 93 deletions
|
|
@ -9,6 +9,7 @@ license = "Apache-2.0"
|
|||
name = "aquatic_udp_load_test"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
bittorrent_udp = { path = "../bittorrent_udp" }
|
||||
cli_helpers = { path = "../cli_helpers" }
|
||||
crossbeam-channel = "0.4"
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ pub fn main(){
|
|||
}
|
||||
|
||||
|
||||
fn run(config: Config){
|
||||
fn run(config: Config) -> ::anyhow::Result<()> {
|
||||
if config.handler.weight_announce + config.handler.weight_connect + config.handler.weight_scrape == 0 {
|
||||
panic!("Error: at least one weight must be larger than zero.");
|
||||
}
|
||||
|
|
@ -129,7 +129,9 @@ fn run(config: Config){
|
|||
monitor_statistics(
|
||||
state,
|
||||
&config
|
||||
)
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue