Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shared/src/main/scala/interpreters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import cats.syntax.traverse._
/**
* An exception thrown from the interpreter when failing to perform a data fetch.
*/
case class FetchFailure[C <: DataSourceCache](env: Env) extends Throwable
case class FetchFailure(env: Env) extends Throwable

trait FetchInterpreters {

Expand Down
8 changes: 4 additions & 4 deletions shared/src/test/scala/FetchTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class FetchTests extends FreeSpec with Matchers {
"Data sources with errors throw fetch failures" in {
val fetch: Fetch[Int] = Fetch(Never())

intercept[FetchFailure[InMemoryCache]] {
intercept[FetchFailure] {
Fetch.runEnv[Eval](fetch).value
} match {
case FetchFailure(env) => {
Expand All @@ -206,7 +206,7 @@ class FetchTests extends FreeSpec with Matchers {
OneSource.identity(One(1)) -> 1
)

intercept[FetchFailure[InMemoryCache]] {
intercept[FetchFailure] {
Fetch.run[Eval](fetch, cache).value
} match {
case FetchFailure(env) => env.cache shouldEqual cache
Expand Down Expand Up @@ -341,15 +341,15 @@ class FetchTests extends FreeSpec with Matchers {
"If there is a missing identity in the left hand of a product the product will fail" in {
val fetch: Fetch[(Int, List[Int])] = Fetch.join(Fetch(Never()), many(3))

intercept[FetchFailure[InMemoryCache]] {
intercept[FetchFailure] {
Fetch.run[Eval](fetch).value
}
}

"If there is a missing identity in the right hand of a product the product will fail" in {
val fetch: Fetch[(List[Int], Int)] = Fetch.join(many(3), Fetch(Never()))

intercept[FetchFailure[InMemoryCache]] {
intercept[FetchFailure] {
Fetch.run[Eval](fetch).value
}
}
Expand Down