@@ -100,21 +100,27 @@ async def _load_workspace_documents(self, sender: Any) -> List[WorkspaceDocument
100
100
async with self .parent .window .progress (
101
101
"Load workspace" , cancellable = True , current = 0 , max = len (files ), start = False
102
102
) as progress :
103
- for i , f in enumerate (files ):
104
- await self .parent .documents .get_or_open_document (f , "robotframework" )
105
-
106
- if config .analysis .progress_mode != AnalysisProgressMode .OFF :
107
- name = f .relative_to (folder .uri .to_path ())
108
-
109
- progress .begin ()
110
- progress .report (
111
- f"Load { str (name )} "
112
- if config .analysis .progress_mode == AnalysisProgressMode .DETAILED
113
- else None ,
114
- current = i ,
115
- )
116
-
117
- self .documents_loaded .set ()
103
+ try :
104
+ for i , f in enumerate (files ):
105
+ try :
106
+ await self .parent .documents .get_or_open_document (f , "robotframework" )
107
+
108
+ if config .analysis .progress_mode != AnalysisProgressMode .OFF :
109
+ name = f .relative_to (folder .uri .to_path ())
110
+
111
+ progress .begin ()
112
+ progress .report (
113
+ f"Load { str (name )} "
114
+ if config .analysis .progress_mode == AnalysisProgressMode .DETAILED
115
+ else None ,
116
+ current = i ,
117
+ )
118
+ except (SystemExit , KeyboardInterrupt ):
119
+ raise
120
+ except BaseException as e :
121
+ self ._logger .critical (f"Can't load document { f } : { e } " )
122
+ finally :
123
+ self .documents_loaded .set ()
118
124
119
125
for i , f in enumerate (files ):
120
126
try :
@@ -154,7 +160,7 @@ async def _load_workspace_documents(self, sender: Any) -> List[WorkspaceDocument
154
160
except (SystemExit , KeyboardInterrupt , asyncio .CancelledError ):
155
161
raise
156
162
except BaseException as e :
157
- self ._logger .exception ( e )
163
+ self ._logger .critical ( f"Can't initialize document { f } : { e } " )
158
164
159
165
if canceled :
160
166
return []
0 commit comments