Skip to content

Commit

Permalink
Ignore operation cancelled exception in try/catch. Fixes #430
Browse files Browse the repository at this point in the history
  • Loading branch information
TheVeryStarlk committed Feb 25, 2024
1 parent 83299c7 commit f459632
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Obsidian/Services/PacketBroadcaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
await player.client.QueuePacketAsync(queuedPacket.Packet);
}
}
catch (Exception e)
catch (Exception e) when (e is not OperationCanceledException)
{
await this.environment.OnServerCrashAsync(this.logger, e);
}
Expand Down
2 changes: 1 addition & 1 deletion Obsidian/WorldData/WorldManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected async override Task ExecuteAsync(CancellationToken stoppingToken)
await Task.WhenAll(this.worlds.Values.Cast<World>().Select(x => x.ManageChunksAsync()));
}
}
catch (Exception ex)
catch (Exception ex) when (ex is not OperationCanceledException)
{
await this.serverEnvironment.OnServerCrashAsync(this.logger, ex);
}
Expand Down

0 comments on commit f459632

Please sign in to comment.