fix: handle channel_rss not found

This commit is contained in:
ThetaDev 2022-10-12 01:13:32 +02:00
parent d4d029c3ce
commit de118c59c4
3 changed files with 30 additions and 2 deletions

View file

@ -17,7 +17,13 @@ impl RustyPipeQuery {
let xml = self
.client
.http_request_txt(self.client.inner.http.get(&url).build()?)
.await?;
.await
.map_err(|e| match e {
Error::HttpStatus(404) => Error::Extraction(ExtractionError::ContentUnavailable(
"Channel not found".into(),
)),
_ => e,
})?;
match quick_xml::de::from_str::<response::ChannelRss>(&xml) {
Ok(feed) => Ok(feed.into()),