From f7a6d2e9c67c1fdf8fc17fa0461a201fd2720537 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Thu, 19 Jan 2023 18:37:42 +0100 Subject: input mostly inplemented, mods missing --- src/commands/download.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/commands/download.rs') diff --git a/src/commands/download.rs b/src/commands/download.rs index b958bf3..0f63876 100644 --- a/src/commands/download.rs +++ b/src/commands/download.rs @@ -1,7 +1,7 @@ -use crate::{files::{get_downloaded_versions, download_versions, delete_version, disable_version}, db::{userlist_get_all_current_versions_with_mods, lists_get_all_ids, lists_get}, modrinth::get_raw_versions}; +use crate::{files::{get_downloaded_versions, download_versions, delete_version, disable_version}, db::{userlist_get_all_current_versions_with_mods, lists_get_all_ids, lists_get}, modrinth::get_raw_versions, error::{MLE, ErrorType, MLError}}; use crate::{List, get_current_list, config::Cfg, input::Input}; -pub async fn download(config: Cfg, input: Input) -> Result<(), Box> { +pub async fn download(config: Cfg, input: Input) -> MLE<()> { let mut liststack: Vec = vec![]; if input.all_lists { @@ -18,7 +18,10 @@ pub async fn download(config: Cfg, input: Input) -> Result<(), Box Ok(i), + Err(e) => Err(MLError::new(ErrorType::DBError, e.to_string().as_str())), + }?; let mut to_download: Vec = vec![]; //(mod_id, version_id) @@ -33,7 +36,7 @@ pub async fn download(config: Cfg, input: Input) -> Result<(), Box