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>(
28
28
29
29
private suspend fun flowApiCall (call : Call <T >): Result <T > {
30
30
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
+ }
36
35
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
+ })
44
40
45
41
continuation.invokeOnCancellation {
46
42
call.cancel()
You can’t perform that action at this time.
0 commit comments