Skip to content

Commit 70a390a

Browse files
committed
gracefully handle SEHException in GitProvider, ref. #2386
1 parent 19d0f43 commit 70a390a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Rubberduck.SourceControl/GitProvider.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,13 +495,17 @@ public override IEnumerable<IFileStatusEntry> Status()
495495
try
496496
{
497497
base.Status();
498-
return _repo.RetrieveStatus(new StatusOptions {IncludeUnaltered = true, DetectRenamesInWorkDir = true })
499-
.Select(item => new FileStatusEntry(item));
498+
return _repo.RetrieveStatus(new StatusOptions {IncludeUnaltered = true, DetectRenamesInWorkDir = true})
499+
.Select(item => new FileStatusEntry(item));
500500
}
501501
catch (LibGit2SharpException ex)
502502
{
503503
throw new SourceControlException(SourceControlText.GitRepoStatusFailed, ex);
504504
}
505+
catch (SEHException ex)
506+
{
507+
throw new SourceControlException(SourceControlText.GitRepoStatusFailed, ex);
508+
}
505509
}
506510

507511
public override IEnumerable<IFileStatusEntry> LastKnownStatus()

Rubberduck.VBEEditor/SafeComWrappers/VBA/VBComponents.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public void ImportSourceFile(string path)
118118
var component = this[name];
119119
if (component.IsWrappingNullReference)
120120
{
121-
throw new InvalidOperationException(string.Format("Could not find document component named '{0}'.", name));
121+
throw new IndexOutOfRangeException(string.Format("Could not find document component named '{0}'.", name));
122122
}
123123
component.CodeModule.Clear();
124124
component.CodeModule.AddFromString(codeString);

0 commit comments

Comments
 (0)