Skip to content

Commit 76ac84b

Browse files
committed
Fix cancellation rethrow behaviour in RubberduckParserState
1 parent 04b08cd commit 76ac84b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Rubberduck.Parsing/VBA/RubberduckParserState.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,12 @@ private void OnStateChanged(object requestor, CancellationToken token, ParserSta
401401
var args = new ParserStateEventArgs(state, oldStatus, token);
402402
handler.Invoke(requestor, args);
403403
}
404+
catch (OperationCanceledException cancellation)
405+
{
406+
throw;
407+
}
404408
catch (Exception e)
405409
{
406-
if (e is OperationCanceledException cancellation)
407-
{
408-
throw cancellation;
409-
}
410410
// Error state, because this implies consumers are not exception-safe!
411411
// this behaviour could leave us in a state where some consumers have correctly updated and some have not
412412
Logger.Error(e, "An exception occurred when notifying consumers of updated parser state.");

0 commit comments

Comments
 (0)