Skip to content

Commit 6b370b5

Browse files
feat(client): get rid of annoying checked exceptions (#790)
1 parent a26984e commit 6b370b5

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

increase-java-core/src/main/kotlin/com/increase/api/core/http/HttpClient.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ interface HttpClient : AutoCloseable {
1919
request: HttpRequest,
2020
requestOptions: RequestOptions = RequestOptions.none(),
2121
): CompletableFuture<HttpResponse>
22+
23+
/** Overridden from [AutoCloseable] to not have a checked exception in its signature. */
24+
override fun close()
2225
}

increase-java-core/src/main/kotlin/com/increase/api/core/http/HttpRequestBody.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package com.increase.api.core.http
22

3-
import java.io.IOException
43
import java.io.OutputStream
54
import java.lang.AutoCloseable
65

76
interface HttpRequestBody : AutoCloseable {
87

9-
@Throws(IOException::class) fun writeTo(outputStream: OutputStream)
8+
fun writeTo(outputStream: OutputStream)
109

1110
fun contentType(): String?
1211

@@ -21,5 +20,6 @@ interface HttpRequestBody : AutoCloseable {
2120
*/
2221
fun repeatable(): Boolean
2322

23+
/** Overridden from [AutoCloseable] to not have a checked exception in its signature. */
2424
override fun close()
2525
}

increase-java-core/src/main/kotlin/com/increase/api/core/http/HttpResponse.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ interface HttpResponse : AutoCloseable {
1111

1212
fun body(): InputStream
1313

14+
/** Overridden from [AutoCloseable] to not have a checked exception in its signature. */
15+
override fun close()
16+
1417
interface Handler<T> {
1518

1619
fun handle(response: HttpResponse): T

0 commit comments

Comments
 (0)