diff --git a/src/subcommands/main_subcommand.rs b/src/subcommands/main_subcommand.rs index c8a4251..b96a1b5 100644 --- a/src/subcommands/main_subcommand.rs +++ b/src/subcommands/main_subcommand.rs @@ -77,14 +77,12 @@ impl MainSubcommand { let file_station = self.file_station.clone().context("File Station should not be null.")?; - // Check if folder exists - let path_parts = configuration.path.split('/'); let name = path_parts.last().context("Our path should have a name")?; // We remove one extra character so that we don't have a trailing '/'. let folder_path_string = configuration.path[..(configuration.path.len() - name.len() - 1)].to_string(); let folder_path = folder_path_string.as_str(); - let _folders = file_station.create_folder(folder_path, name, false).await?; + let _folders = file_station.create_folder(folder_path, name, true).await?; Ok(()) } diff --git a/src/synology_api/responses.rs b/src/synology_api/responses.rs index 0830e9b..452c040 100644 --- a/src/synology_api/responses.rs +++ b/src/synology_api/responses.rs @@ -76,13 +76,13 @@ pub enum SynologyStatusCode { #[derive(Error, Debug)] pub enum SynologyErrorStatus { - #[error("Error occurred on Synology.")] + #[error(transparent)] ServerError(#[from] SynologyStatusCode), #[error("HTTP error occurred.")] HttpError(StatusCode), - #[error("Reqwest threw an error.")] + #[error(transparent)] ReqwestError(#[from] reqwest::Error), - #[error("Serde threw an error.")] + #[error(transparent)] SerdeError(#[from] serde_json::Error), #[error("TOTP required but not provided")] NoTotp,