Log JSON parsing errors
This commit is contained in:
parent
22eba91a17
commit
b2505ce086
1 changed files with 21 additions and 1 deletions
|
@ -91,7 +91,27 @@ pub async fn play(
|
||||||
let mut handler = handler_lock.lock().await;
|
let mut handler = handler_lock.lock().await;
|
||||||
|
|
||||||
debug!("Trying to play: {}", url);
|
debug!("Trying to play: {}", url);
|
||||||
let source = songbird::ytdl(&url).await?;
|
let source = songbird::ytdl(&url).await;
|
||||||
|
|
||||||
|
let source = match source {
|
||||||
|
Ok(source) => source,
|
||||||
|
Err(e) => {
|
||||||
|
match e {
|
||||||
|
songbird::input::error::Error::Json {
|
||||||
|
ref error,
|
||||||
|
ref parsed_text,
|
||||||
|
} => {
|
||||||
|
debug!("Failed to play: {}", error);
|
||||||
|
debug!("Parsed text: {}", parsed_text);
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
debug!("Failed to play: {}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Err(Box::new(e));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
debug!("Playing: {:?}", source.metadata);
|
debug!("Playing: {:?}", source.metadata);
|
||||||
let title = source
|
let title = source
|
||||||
.metadata
|
.metadata
|
||||||
|
|
Loading…
Add table
Reference in a new issue