mirror of
https://github.com/kristoferssolo/tg-relay-rs.git
synced 2026-02-04 06:42:09 +00:00
refactor: remove instaloader errors
This commit is contained in:
@@ -34,7 +34,7 @@ pub struct DownloadResult {
|
||||
///
|
||||
/// # 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).
|
||||
///
|
||||
/// # Errors
|
||||
@@ -64,7 +64,6 @@ async fn run_command_in_tempdir(cmd: &str, args: &[&str]) -> Result<DownloadResu
|
||||
}
|
||||
|
||||
let err = match cmd {
|
||||
"instaloader" => Error::instaloader_failed(stderr),
|
||||
"yt-dlp" => Error::ytdlp_failed(stderr),
|
||||
_ => Error::Other(format!("{cmd} failed: {stderr}")),
|
||||
};
|
||||
|
||||
@@ -5,9 +5,6 @@ pub enum Error {
|
||||
#[error("io error: {0}")]
|
||||
Io(#[from] tokio::io::Error),
|
||||
|
||||
#[error("instaloader failed: {0}")]
|
||||
InstaloaderFailed(String),
|
||||
|
||||
#[error("yt-dpl failed: {0}")]
|
||||
YTDLPFailed(String),
|
||||
|
||||
@@ -39,11 +36,6 @@ impl Error {
|
||||
Self::Other(text.into())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn instaloader_failed(text: impl Into<String>) -> Self {
|
||||
Self::InstaloaderFailed(text.into())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn ytdlp_failed(text: impl Into<String>) -> Self {
|
||||
Self::YTDLPFailed(text.into())
|
||||
|
||||
Reference in New Issue
Block a user