Skip to content

Commit

Permalink
Repport CURL connect exception
Browse files Browse the repository at this point in the history
  • Loading branch information
e5l committed Feb 21, 2019
1 parent 0409de4 commit 270f470
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ internal class CurlMultiApiHandler : Closeable {
)
}

if (httpStatusCode.value == 0L) {
return CurlFail(
responseBuilder.request,
CurlIllegalStateException("Connection failed for request: ${responseBuilder.request}")
)
}

with(responseBuilder) {
val headers = headersBytes.build().readBytes()
val body = bodyBytes.build().readBytes()
Expand Down

0 comments on commit 270f470

Please sign in to comment.