Skip to content

Commit 1e23c30

Browse files
committed
Log failed Try* in SelectionService
1 parent a02424e commit 1e23c30

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Rubberduck.VBEEditor/Utility/SelectionService.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using NLog;
23
using Rubberduck.VBEditor.ComManagement;
34
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
45

@@ -9,6 +10,8 @@ public class SelectionService : ISelectionService
910
private readonly IProjectsProvider _projectsProvider;
1011
private readonly IVBE _vbe;
1112

13+
private Logger _logger = LogManager.GetCurrentClassLogger();
14+
1215
public SelectionService(IVBE vbe, IProjectsProvider projectsProvider)
1316
{
1417
_vbe = vbe;
@@ -57,8 +60,9 @@ public bool TryActivate(QualifiedModuleName module)
5760

5861
return true;
5962
}
60-
catch (Exception)
63+
catch (Exception exception)
6164
{
65+
_logger.Debug(exception, $"Failed to activate the code pane of module {module}.");
6266
return false;
6367
}
6468
}
@@ -99,8 +103,9 @@ public bool TrySetSelection(QualifiedModuleName module, Selection selection)
99103

100104
return true;
101105
}
102-
catch (Exception)
106+
catch (Exception exception)
103107
{
108+
_logger.Debug(exception, $"Failed to set the selection of module {module} to {selection}.");
104109
return false;
105110
}
106111
}

0 commit comments

Comments
 (0)