File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed
Rubberduck.VBEditor.VB6/SafeComWrappers/VB
Rubberduck.VBEditor.VBA/SafeComWrappers/VB Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,10 @@ public void InsertLines(int line, string content)
128
128
}
129
129
catch ( Exception e )
130
130
{
131
- _logger . Error ( e ) ;
131
+ // "too many line continuations" is one possible cause for a COMException here.
132
+ // deleting the only line in a module is another.
133
+ // we can log the exception, but really we're just intentionally swallowing it.
134
+ _logger . Warn ( e , $ "{ nameof ( InsertLines ) } failed.") ;
132
135
}
133
136
}
134
137
@@ -142,7 +145,10 @@ public void DeleteLines(int startLine, int count = 1)
142
145
}
143
146
catch ( Exception e )
144
147
{
145
- _logger . Error ( e ) ;
148
+ // "too many line continuations" is one possible cause for a COMException here.
149
+ // deleting the only line in a module is another.
150
+ // we can log the exception, but really we're just intentionally swallowing it.
151
+ _logger . Warn ( e , $ "{ nameof ( DeleteLines ) } failed.") ;
146
152
}
147
153
}
148
154
@@ -160,7 +166,10 @@ public void ReplaceLine(int line, string content)
160
166
}
161
167
catch ( Exception e )
162
168
{
163
- _logger . Error ( e ) ;
169
+ // "too many line continuations" is one possible cause for a COMException here.
170
+ // deleting the only line in a module is another.
171
+ // we can log the exception, but really we're just intentionally swallowing it.
172
+ _logger . Warn ( e , $ "{ nameof ( ReplaceLine ) } failed.") ;
164
173
}
165
174
}
166
175
Original file line number Diff line number Diff line change @@ -129,8 +129,9 @@ public void InsertLines(int line, string content)
129
129
catch ( Exception e )
130
130
{
131
131
// "too many line continuations" is one possible cause for a COMException here.
132
- _logger . Error ( e ) ;
133
- throw ;
132
+ // deleting the only line in a module is another.
133
+ // we can log the exception, but really we're just intentionally swallowing it.
134
+ _logger . Warn ( e , $ "{ nameof ( InsertLines ) } failed.") ;
134
135
}
135
136
}
136
137
@@ -148,8 +149,9 @@ public void DeleteLines(int startLine, int count = 1)
148
149
catch ( Exception e )
149
150
{
150
151
// "too many line continuations" is one possible cause for a COMException here.
151
- _logger . Error ( e ) ;
152
- throw ;
152
+ // deleting the only line in a module is another.
153
+ // we can log the exception, but really we're just intentionally swallowing it.
154
+ _logger . Warn ( e , $ "{ nameof ( DeleteLines ) } failed.") ;
153
155
}
154
156
}
155
157
}
@@ -176,8 +178,9 @@ public void ReplaceLine(int line, string content)
176
178
catch ( Exception e )
177
179
{
178
180
// "too many line continuations" is one possible cause for a COMException here.
179
- _logger . Error ( e ) ;
180
- throw ;
181
+ // deleting the only line in a module is another.
182
+ // we can log the exception, but really we're just intentionally swallowing it.
183
+ _logger . Warn ( e , $ "{ nameof ( ReplaceLine ) } failed.") ;
181
184
}
182
185
}
183
186
You can’t perform that action at this time.
0 commit comments