Skip to content

Commit 4af8786

Browse files
authored
Remove Okio internal api usage (#621)
1 parent 153c106 commit 4af8786

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

api-client/src/main/kotlin/de/gesellix/docker/remote/api/core/ResponseConsumer.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import kotlinx.coroutines.flow.Flow
77
import kotlinx.coroutines.flow.emptyFlow
88
import kotlinx.coroutines.flow.flow
99
import okhttp3.ResponseBody
10-
import okhttp3.internal.closeQuietly
10+
import okio.Closeable
1111
import okio.appendingSink
1212
import okio.buffer
1313
import java.io.File
@@ -112,3 +112,12 @@ inline fun <reified T : Any?> ResponseBody.consumeJson(type: Type): T? {
112112
// //ignore
113113
// }
114114
//}
115+
116+
fun Closeable.closeQuietly() {
117+
try {
118+
close()
119+
} catch (rethrown: RuntimeException) {
120+
throw rethrown
121+
} catch (_: Exception) {
122+
}
123+
}

0 commit comments

Comments
 (0)