@@ -9,7 +9,7 @@ pub(crate) use crate::application::app_data::AppData;
9
9
use crate :: {
10
10
Args ,
11
11
Exit ,
12
- config:: { Config , ConfigLoader , DiffIgnoreWhitespaceSetting } ,
12
+ config:: { Config , ConfigError , ConfigErrorCause , ConfigLoader , DiffIgnoreWhitespaceSetting } ,
13
13
diff:: { self , CommitDiffLoader , CommitDiffLoaderOptions } ,
14
14
display:: Display ,
15
15
git:: open_repository_from_env,
@@ -42,7 +42,8 @@ where ModuleProvider: module::ModuleProvider + Send + 'static
42
42
let filepath = Self :: filepath_from_args ( args) ?;
43
43
let repository = Self :: open_repository ( ) ?;
44
44
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 ( ) ) ) ?;
46
47
let todo_file = Arc :: new ( Mutex :: new ( Self :: load_todo_file ( filepath. as_str ( ) , & config) ?) ) ;
47
48
48
49
let display = Display :: new ( tui, & config. theme ) ;
@@ -162,8 +163,11 @@ where ModuleProvider: module::ModuleProvider + Send + 'static
162
163
} )
163
164
}
164
165
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) )
167
171
}
168
172
169
173
fn todo_file_options ( config : & Config ) -> TodoFileOptions {
0 commit comments