@@ -76,7 +76,10 @@ public ProjectLoadOutcome LoadProject (string projectFileName)
7676 LayoutXml = layoutXml
7777 } ;
7878 }
79- catch ( Exception ex )
79+ catch ( Exception ex ) when ( ex is IOException or
80+ UnauthorizedAccessException or
81+ InvalidOperationException or
82+ Newtonsoft . Json . JsonException )
8083 {
8184 _logger . Error ( ex , "LoadProject: Exception loading {FileName}" , projectFileName ) ;
8285
@@ -116,7 +119,10 @@ public ContinueLoadResult ContinueLoad (ProjectLoadOutcome loadOutcome, MissingF
116119 ProjectPersister . SaveProjectData ( projectData . ProjectFilePath , projectData ) ;
117120 _logger . Info ( "ContinueLoad: Updated session file {FileName}" , projectData . ProjectFilePath ) ;
118121 }
119- catch ( Exception ex )
122+ catch ( Exception ex ) when ( ex is IOException or
123+ UnauthorizedAccessException or
124+ InvalidOperationException or
125+ ArgumentException )
120126 {
121127 _logger . Error ( ex , "ContinueLoad: Failed to update session file {FileName}" , projectData . ProjectFilePath ) ;
122128 }
@@ -154,7 +160,14 @@ public ContinueLoadResult ContinueLoad (ProjectLoadOutcome loadOutcome, MissingF
154160 _ = addFileTab ( request ) ;
155161 openedCount ++ ;
156162 }
157- catch ( Exception ex )
163+ catch ( Exception ex ) when ( ex is not OutOfMemoryException
164+ and not StackOverflowException
165+ and not AccessViolationException
166+ and not AppDomainUnloadedException
167+ and not BadImageFormatException
168+ and not CannotUnloadAppDomainException
169+ and not InvalidProgramException
170+ and not ThreadAbortException )
158171 {
159172 _logger . Error ( ex , "ContinueLoad: Failed to open tab for {FileName}" , fileName ) ;
160173 }
@@ -176,7 +189,10 @@ public bool SaveProject (string projectFileName, ProjectData projectData, out st
176189 errorMessage = null ;
177190 return true ;
178191 }
179- catch ( Exception ex )
192+ catch ( Exception ex ) when ( ex is IOException or
193+ UnauthorizedAccessException or
194+ InvalidOperationException or
195+ ArgumentException )
180196 {
181197 _logger . Error ( ex , "SaveProject: Failed to save {FileName}" , projectFileName ) ;
182198 errorMessage = $ "Error saving project: { ex . Message } ";
0 commit comments