@@ -9,7 +9,7 @@ pub(crate) use crate::application::app_data::AppData;
99use crate :: {
1010 Args ,
1111 Exit ,
12- config:: { Config , ConfigLoader , DiffIgnoreWhitespaceSetting } ,
12+ config:: { Config , ConfigError , ConfigErrorCause , ConfigLoader , DiffIgnoreWhitespaceSetting } ,
1313 diff:: { self , CommitDiffLoader , CommitDiffLoaderOptions } ,
1414 display:: Display ,
1515 git:: open_repository_from_env,
@@ -42,7 +42,8 @@ where ModuleProvider: module::ModuleProvider + Send + 'static
4242 let filepath = Self :: filepath_from_args ( args) ?;
4343 let repository = Self :: open_repository ( ) ?;
4444 let config_loader = ConfigLoader :: from ( repository) ;
45- let config = Self :: load_config ( & config_loader) ?;
45+ let config = Self :: load_config ( & config_loader)
46+ . map_err ( |err| Exit :: new ( ExitStatus :: ConfigError , format ! ( "{err:#}" ) . as_str ( ) ) ) ?;
4647 let todo_file = Arc :: new ( Mutex :: new ( Self :: load_todo_file ( filepath. as_str ( ) , & config) ?) ) ;
4748
4849 let display = Display :: new ( tui, & config. theme ) ;
@@ -162,8 +163,11 @@ where ModuleProvider: module::ModuleProvider + Send + 'static
162163 } )
163164 }
164165
165- fn load_config ( config_loader : & ConfigLoader ) -> Result < Config , Exit > {
166- Config :: try_from ( config_loader) . map_err ( |err| Exit :: new ( ExitStatus :: ConfigError , format ! ( "{err:#}" ) . as_str ( ) ) )
166+ fn load_config ( config_loader : & ConfigLoader ) -> Result < Config , ConfigError > {
167+ let config = config_loader
168+ . load_config ( )
169+ . map_err ( |e| ConfigError :: new_read_error ( "" , ConfigErrorCause :: GitError ( e) ) ) ?;
170+ Config :: new_with_config ( Some ( & config) )
167171 }
168172
169173 fn todo_file_options ( config : & Config ) -> TodoFileOptions {
0 commit comments