Skip to content

Commit

Permalink
Merge pull request #329 from lgmyrek/hotfix/issue-327-class-casts-exc…
Browse files Browse the repository at this point in the history
…eptions-on-throwables

Replaced Exception with Throwable to match all possible results of Future.failed
  • Loading branch information
OlegIlyenko committed Jan 20, 2018
2 parents 9ec1c61 + fb802f0 commit 4f96ea2
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class FetcherBasedDeferredResolver[-Ctx](fetchers: Vector[Fetcher[Ctx, _, _, _]]

case FetcherDeferredOne(_, id)
m.get(id) match {
case Some(e: Exception) throw e
case Some(t: Throwable) throw t
case Some(v) updateCache(id, v)
case None throw AbsentDeferredValueError(f, deferred, id)
}
Expand All @@ -218,7 +218,7 @@ class FetcherBasedDeferredResolver[-Ctx](fetchers: Vector[Fetcher[Ctx, _, _, _]]

case FetcherDeferredOpt(_, id)
m.get(id) match {
case Some(e: Exception) throw e
case Some(t: Throwable) throw t
case v
v foreach (updateCache(id, _))

Expand All @@ -233,7 +233,7 @@ class FetcherBasedDeferredResolver[-Ctx](fetchers: Vector[Fetcher[Ctx, _, _, _]]

case FetcherDeferredOptOpt(_, Some(id))
m.get(id) match {
case Some(e: Exception) throw e
case Some(t: Throwable) throw t
case v
v foreach (updateCache(id, _))

Expand All @@ -246,7 +246,7 @@ class FetcherBasedDeferredResolver[-Ctx](fetchers: Vector[Fetcher[Ctx, _, _, _]]
cachedResults(id)
else
m.get(id) match {
case Some(e: Exception) throw e
case Some(t: Throwable) throw t
case Some(v) updateCache(id, v)
case None throw AbsentDeferredValueError(f, deferred, id)
}
Expand All @@ -258,7 +258,7 @@ class FetcherBasedDeferredResolver[-Ctx](fetchers: Vector[Fetcher[Ctx, _, _, _]]
cachedResults.get(id)
else
m.get(id) match {
case Some(e: Exception) throw e
case Some(t: Throwable) throw t
case v
v foreach (updateCache(id, _))

Expand All @@ -272,7 +272,7 @@ class FetcherBasedDeferredResolver[-Ctx](fetchers: Vector[Fetcher[Ctx, _, _, _]]
cachedResults.get(id)
else
m.get(id) match {
case Some(e: Exception) throw e
case Some(t: Throwable) throw t
case v
v foreach (updateCache(id, _))

Expand Down

0 comments on commit 4f96ea2

Please sign in to comment.