mirror of
https://github.com/kristoferssolo/tg-relay-rs.git
synced 2025-12-20 11:04:41 +00:00
refactor: remove instaloader errors
This commit is contained in:
parent
40ae0b7371
commit
2347c1b440
@ -34,7 +34,7 @@ pub struct DownloadResult {
|
|||||||
///
|
///
|
||||||
/// # Arguments
|
/// # Arguments
|
||||||
///
|
///
|
||||||
/// `cmd` is the command name (e.g. "yt-dlp" or "instaloader").
|
/// `cmd` is the command name (e.g. "yt-dlp").
|
||||||
/// `args` are the command arguments (owned Strings so callers can build dynamic args).
|
/// `args` are the command arguments (owned Strings so callers can build dynamic args).
|
||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
@ -64,7 +64,6 @@ async fn run_command_in_tempdir(cmd: &str, args: &[&str]) -> Result<DownloadResu
|
|||||||
}
|
}
|
||||||
|
|
||||||
let err = match cmd {
|
let err = match cmd {
|
||||||
"instaloader" => Error::instaloader_failed(stderr),
|
|
||||||
"yt-dlp" => Error::ytdlp_failed(stderr),
|
"yt-dlp" => Error::ytdlp_failed(stderr),
|
||||||
_ => Error::Other(format!("{cmd} failed: {stderr}")),
|
_ => Error::Other(format!("{cmd} failed: {stderr}")),
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,9 +5,6 @@ pub enum Error {
|
|||||||
#[error("io error: {0}")]
|
#[error("io error: {0}")]
|
||||||
Io(#[from] tokio::io::Error),
|
Io(#[from] tokio::io::Error),
|
||||||
|
|
||||||
#[error("instaloader failed: {0}")]
|
|
||||||
InstaloaderFailed(String),
|
|
||||||
|
|
||||||
#[error("yt-dpl failed: {0}")]
|
#[error("yt-dpl failed: {0}")]
|
||||||
YTDLPFailed(String),
|
YTDLPFailed(String),
|
||||||
|
|
||||||
@ -39,11 +36,6 @@ impl Error {
|
|||||||
Self::Other(text.into())
|
Self::Other(text.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn instaloader_failed(text: impl Into<String>) -> Self {
|
|
||||||
Self::InstaloaderFailed(text.into())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn ytdlp_failed(text: impl Into<String>) -> Self {
|
pub fn ytdlp_failed(text: impl Into<String>) -> Self {
|
||||||
Self::YTDLPFailed(text.into())
|
Self::YTDLPFailed(text.into())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user