@@ -6,8 +6,8 @@ import io.outblock.fcl.config.Config
66import io.outblock.fcl.models.response.PollingResponse
77import io.outblock.fcl.models.response.ResponseStatus
88import io.outblock.fcl.models.response.Service
9- import io.outblock.fcl.utils.FCLException
109import io.outblock.fcl.utils.FclError
10+ import io.outblock.fcl.utils.FclException
1111import io.outblock.fcl.utils.repeatWhen
1212import io.outblock.fcl.utils.runBlockDelay
1313import io.outblock.fcl.webview.FCLWebViewLifecycle
@@ -38,7 +38,7 @@ internal suspend fun execHttpPost(url: String, params: Map<String, String>? = ma
3838 ResponseStatus .APPROVED -> WebViewActivity .close()
3939 ResponseStatus .DECLINED -> {
4040 WebViewActivity .close()
41- throw FCLException (FclError .declined)
41+ throw FclException (FclError .declined)
4242 }
4343 ResponseStatus .PENDING -> return tryPollService(response)
4444 }
@@ -95,13 +95,13 @@ private suspend fun tryPollService(
9595 response : PollingResponse ,
9696): PollingResponse {
9797 PollServiceState .poll()
98- val local = response.local() ? : throw FCLException (FclError .generic)
99- val updates = (response.updates ? : response.authorizationUpdates) ? : throw FCLException (FclError .generic)
98+ val local = response.local() ? : throw FclException (FclError .generic)
99+ val updates = (response.updates ? : response.authorizationUpdates) ? : throw FclException (FclError .generic)
100100
101101 try {
102102 local.openAuthenticationWebView()
103103 } catch (e: Exception ) {
104- throw FCLException (FclError .generic, exception = e)
104+ throw FclException (FclError .generic, exception = e)
105105 }
106106
107107
@@ -120,15 +120,15 @@ private suspend fun poll(service: Service): PollingResponse? {
120120 return null
121121 }
122122
123- val url = service.endpoint ? : throw FCLException (FclError .invaildURL)
123+ val url = service.endpoint ? : throw FclException (FclError .invaildURL)
124124
125125 val response = retrofitAuthApi().executeGet(url, service.params)
126126
127127 when (response.status) {
128128 ResponseStatus .APPROVED -> WebViewActivity .close()
129129 ResponseStatus .DECLINED -> {
130130 WebViewActivity .close()
131- throw FCLException (FclError .declined)
131+ throw FclException (FclError .declined)
132132 }
133133 else -> return response
134134 }
0 commit comments