Skip to content

Commit 8d2d3b3

Browse files
committed
[mod] CallAdapter runCatching 제거
*PR 대응
1 parent fb47c47 commit 8d2d3b3

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

app/src/main/java/com/runnect/runnect/data/network/calladapter/flow/FlowCallAdapter.kt

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,15 @@ class FlowCallAdapter<T>(
2828

2929
private suspend fun flowApiCall(call: Call<T>): Result<T> {
3030
return suspendCancellableCoroutine { continuation ->
31-
runCatching {
32-
call.enqueue(object : Callback<T> {
33-
override fun onResponse(call: Call<T>, response: Response<T>) {
34-
continuation.resume(parseResponse(response))
35-
}
31+
call.enqueue(object : Callback<T> {
32+
override fun onResponse(call: Call<T>, response: Response<T>) {
33+
continuation.resume(parseResponse(response))
34+
}
3635

37-
override fun onFailure(call: Call<T>, t: Throwable) {
38-
continuation.resumeWithException(t)
39-
}
40-
})
41-
}.onFailure {
42-
continuation.resumeWithException(it)
43-
}
36+
override fun onFailure(call: Call<T>, t: Throwable) {
37+
continuation.resumeWithException(t)
38+
}
39+
})
4440

4541
continuation.invokeOnCancellation {
4642
call.cancel()

0 commit comments

Comments
 (0)