future icon indicating copy to clipboard operation
future copied to clipboard

Fix recover/recoverWith MatchError if partial function is not satisfied and handle exception within it

Open mosyp opened this issue 6 years ago • 0 comments

Problem

Recover functions in scala futures does not handle partial functions well

Solution

  • use convenient transform in recover
  • modify onException block with isDefinedAt & exp handler in recoverWith

Checklist

  • [x] Read CONTRIBUTING.md
  • [x] Unit test all changes
  • [x] Update README.md if applicable
  • [x] Add [WIP] to the pull request title if it's work in progress
  • [x] Squash commits that aren't meaningful changes

mosyp avatar Jun 05 '19 13:06 mosyp