Updated on 2026-08-14
This commit is contained in:
commit
e303990821
1 changed files with 8 additions and 6 deletions
|
|
@ -11,7 +11,6 @@ class StatusCodeInterceptor : Interceptor {
|
|||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
val originalResponse = chain.proceed(chain.request())
|
||||
|
||||
|
||||
if (shouldInterceptResponse(originalResponse)) {
|
||||
Timber.e("StatusCodeInterceptor INTERCEPTED%s", originalResponse.request.url.toString())
|
||||
|
||||
|
|
@ -29,15 +28,14 @@ class StatusCodeInterceptor : Interceptor {
|
|||
|
||||
private fun shouldInterceptResponse(response: Response): Boolean {
|
||||
return response.request.url.toString().contains("exchange-quote")
|
||||
// && response.request.url.toString().contains("changenow")
|
||||
// && response.request.url.toString().contains("changenow")
|
||||
}
|
||||
|
||||
|
||||
private fun getCode() : Int {
|
||||
return 400
|
||||
private fun getCode(): Int {
|
||||
return CODE_400
|
||||
}
|
||||
|
||||
private fun getBody() : String {
|
||||
private fun getBody(): String {
|
||||
return "\"error\": {\n" +
|
||||
" \"code\": 2290,\n" +
|
||||
" \"description\": \"Core: receivedDecimals is not equal to expressDecimals\",\n" +
|
||||
|
|
@ -46,4 +44,8 @@ class StatusCodeInterceptor : Interceptor {
|
|||
" \"expressToDecimals\": 5\n" +
|
||||
" }"
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val CODE_400 = 400
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue