@@ -70,47 +70,33 @@ configuration_or_error configuration_loader::load_for_file(
70
70
71
71
configuration_or_error configuration_loader::load_for_file (
72
72
const file_to_lint& file) {
73
- if (file. config_file ) {
74
- return boost::leaf::try_handle_all (
75
- [&]() -> boost::leaf::result<configuration_or_error> {
73
+ return boost::leaf::try_handle_all (
74
+ [&]() -> boost::leaf::result<configuration_or_error> {
75
+ if (file. config_file ) {
76
76
return this ->load_config_file (file.config_file );
77
- },
78
- make_canonicalize_path_error_handlers (
79
- [](std::string&& message) -> configuration_or_error {
80
- return configuration_or_error (std::move (message));
81
- }),
82
- make_read_file_error_handlers (
83
- [](std::string&& message) -> configuration_or_error {
84
- return configuration_or_error (std::move (message));
85
- }),
86
- []() {
87
- QLJS_ASSERT (false );
88
- return configuration_or_error (" unknown error" );
89
- });
90
- } else {
91
- if (file.path ) {
92
- return this ->find_and_load_config_file_for_input (file.path );
93
- } else {
94
- return boost::leaf::try_handle_all (
95
- [&]() -> boost::leaf::result<configuration_or_error> {
77
+ } else {
78
+ if (file.path ) {
79
+ return this ->find_and_load_config_file_for_input (file.path );
80
+ } else {
96
81
return this ->find_and_load_config_file_for_current_directory ();
97
- },
98
- make_canonicalize_path_error_handlers (
99
- [](std::string&& message) -> configuration_or_error {
100
- return configuration_or_error (std::move (message));
101
- }),
102
- make_read_file_error_handlers ([](std::string&& message) {
82
+ }
83
+ }
84
+ },
85
+ make_canonicalize_path_error_handlers (
86
+ [](std::string&& message) -> configuration_or_error {
103
87
return configuration_or_error (std::move (message));
104
88
}),
105
- [](boost::leaf::e_errno error) {
106
- return configuration_or_error (std::strerror (error.value ));
107
- },
108
- []() {
109
- QLJS_ASSERT (false );
110
- return configuration_or_error (" unknown error" );
111
- });
112
- }
113
- }
89
+ make_read_file_error_handlers (
90
+ [](std::string&& message) -> configuration_or_error {
91
+ return configuration_or_error (std::move (message));
92
+ }),
93
+ [](boost::leaf::e_errno error) {
94
+ return configuration_or_error (std::strerror (error.value ));
95
+ },
96
+ []() {
97
+ QLJS_ASSERT (false );
98
+ return configuration_or_error (" unknown error" );
99
+ });
114
100
}
115
101
116
102
boost::leaf::result<configuration*> configuration_loader::load_config_file (
0 commit comments