Skip to content

Commit

Permalink
Catch ObjectDisposedException
Browse files Browse the repository at this point in the history
  • Loading branch information
longfin committed Jun 7, 2019
1 parent 75e6d85 commit 268147f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ To be released.

- Fixed a bug that `Swarm` reported `TaskCanceledException` as an unknown
exception while stopping. [[#275]]
- Fixed a bug that `Swarm` didn't stop properly during `Swarm.Preload()`.
[[#275]]

[#270]: https://github.com/planetarium/libplanet/pull/270
[#273]: https://github.com/planetarium/libplanet/issues/273
Expand Down
7 changes: 7 additions & 0 deletions Libplanet/Net/Swarm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,13 @@ await FillBlocksAsync(
peer, synced, stop, progress, cancellationToken);
break;
}

// We can't recover with TaskCanceledException and
// ObjectDisposedException. so just re-throw them.
catch (ObjectDisposedException)
{
throw;
}
catch (TaskCanceledException)
{
throw;
Expand Down

0 comments on commit 268147f

Please sign in to comment.