File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,13 @@ fn get_installed_mods_sync(mods_folder_path: String) -> Vec<LocalMod> {
159159
160160 for entry in fs:: read_dir ( mods_folder_path) . unwrap ( ) {
161161 let entry = entry. unwrap ( ) ;
162+ println ! ( "Checking mod entry: {:?}" , entry. file_name( ) ) ;
162163 let res: anyhow:: Result < _ > = try {
163- let yaml = if entry. file_type ( ) . unwrap ( ) . is_dir ( ) {
164+ if false {
165+ anyhow:: Ok ( ( ) ) ?
166+ }
167+
168+ let yaml = if entry. file_type ( ) . context ( "invalid file type" ) ?. is_dir ( ) {
164169 let cache_path = entry. path ( ) . read_dir ( ) . unwrap ( ) . find ( |v| {
165170 v. as_ref ( )
166171 . map ( |v| {
@@ -212,7 +217,12 @@ fn get_installed_mods_sync(mods_folder_path: String) -> Vec<LocalMod> {
212217 continue ;
213218 } ;
214219
215- let yaml: serde_yaml:: Value = serde_yaml:: from_str ( & yaml) . unwrap ( ) ;
220+ let yaml = serde_yaml:: from_str ( & yaml) ;
221+ if let Err ( e) = yaml {
222+ println ! ( "[ WARNING ] Failed to parse {:?}: {}" , entry. file_name( ) , e) ;
223+ continue ;
224+ }
225+ let yaml: serde_yaml:: Value = yaml. unwrap ( ) ;
216226
217227 let mut deps: Vec < ModDependency > = Vec :: new ( ) ;
218228
You can’t perform that action at this time.
0 commit comments