mirror of
https://github.com/figsoda/mmtc
synced 2024-11-22 15:13:03 +00:00
improve error messages
This commit is contained in:
parent
19729dbb9e
commit
a4fcc8e2cd
1 changed files with 7 additions and 4 deletions
11
src/main.rs
11
src/main.rs
|
@ -155,11 +155,14 @@ async fn run() -> Result<()> {
|
|||
};
|
||||
|
||||
let addr = &opts.address.unwrap_or(cfg.address);
|
||||
let mut idle_cl = Client::init(addr).await?;
|
||||
let mut cl = Client::init(addr).await?;
|
||||
let mut idle_cl = Client::init(addr).await.context("Failed to init client")?;
|
||||
let mut cl = Client::init(addr).await.context("Faield to init client")?;
|
||||
|
||||
let (mut queue, mut queue_strings) = idle_cl.queue(&cfg.search_fields).await?;
|
||||
let mut status = cl.status().await?;
|
||||
let (mut queue, mut queue_strings) = idle_cl
|
||||
.queue(&cfg.search_fields)
|
||||
.await
|
||||
.context("Failed to query queue")?;
|
||||
let mut status = cl.status().await.context("Failed to query status")?;
|
||||
let mut selected = status.song.map_or(0, |song| song.pos);
|
||||
let mut liststate = ListState::default();
|
||||
liststate.select(Some(selected));
|
||||
|
|
Loading…
Reference in a new issue