Skip to content
This repository was archived by the owner on Aug 24, 2018. It is now read-only.

Commit 88c3161

Browse files
committed
don't forward a try as future completion
1 parent 1adafd6 commit 88c3161

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/main/scala_2.10/com/wordnik/swagger/client/ApiClient.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ abstract class ApiClient(client: TransportClient, config: SwaggerConfig){
1212
val fut = Promise[T]()
1313
try {
1414
val r = fn
15-
(r: @unchecked) match {
16-
case tr: Try[T] => fut.complete(tr)
15+
r match {
1716
case t: Throwable => fut.complete(Failure(t))
1817
case s => fut.complete(Success(s))
1918
}

src/main/scala_2.10/com/wordnik/swagger/client/TransportClient.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import scala.concurrent.duration._
77
import java.net.URI
88
import org.json4s._
99
import scala.util.Try
10+
import scala.annotation.implicitNotFound
1011

1112

1213
trait ClientResponse {
@@ -22,6 +23,9 @@ trait ClientResponse {
2223
def body: String
2324
}
2425

26+
@implicitNotFound(
27+
"No ClientResponseReader found for type ${T}. Try to implement an implicit ClientResponseReader for this type, or perhaps you're just missing an import like ClientResponseReader._."
28+
)
2529
trait ClientResponseReader[T] {
2630
def read(resp: ClientResponse): T
2731
}

version.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version in ThisBuild := "0.3.0-WN2"
1+
version in ThisBuild := "0.3.0-WN3"

0 commit comments

Comments
 (0)