File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
app/src/main/java/com/runnect/runnect/data/network/calladapter/flow Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff 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()
You can’t perform that action at this time.
0 commit comments