File tree Expand file tree Collapse file tree
lithic-java-core/src/main/kotlin/com/lithic/api/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -586,8 +586,9 @@ class CardServiceAsyncImpl internal constructor(private val clientOptions: Clien
586586 }
587587 }
588588
589- private val errorHandler: Handler <JsonValue > = errorHandler(clientOptions.jsonMapper)
590- private val embedHandler: Handler <String > = stringHandler().withErrorHandler(errorHandler)
589+ private val errorHandler: Handler <HttpResponse > =
590+ errorHandler(errorBodyHandler(clientOptions.jsonMapper))
591+ private val embedHandler: Handler <String > = stringHandler()
591592
592593 override fun getEmbedHtml (
593594 params : CardGetEmbedHtmlParams ,
@@ -614,7 +615,7 @@ class CardServiceAsyncImpl internal constructor(private val clientOptions: Clien
614615 .build()
615616 return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response
616617 ->
617- response.let { embedHandler.handle(it) }
618+ errorHandler.handle( response) .let { embedHandler.handle(it) }
618619 }
619620 }
620621
Original file line number Diff line number Diff line change 33package com.lithic.api.services.async
44
55import com.lithic.api.core.ClientOptions
6+ import com.lithic.api.core.JsonValue
67import com.lithic.api.core.RequestOptions
78import com.lithic.api.core.checkRequired
89import com.lithic.api.core.handlers.emptyHandler
9-
1010import com.lithic.api.core.handlers.errorBodyHandler
1111import com.lithic.api.core.handlers.errorHandler
1212import com.lithic.api.core.handlers.jsonHandler
Original file line number Diff line number Diff line change @@ -522,8 +522,9 @@ class CardServiceImpl internal constructor(private val clientOptions: ClientOpti
522522 }
523523 }
524524
525- private val errorHandler: Handler <JsonValue > = errorHandler(clientOptions.jsonMapper)
526- private val embedHandler: Handler <String > = stringHandler().withErrorHandler(errorHandler)
525+ private val errorHandler: Handler <HttpResponse > =
526+ errorHandler(errorBodyHandler(clientOptions.jsonMapper))
527+ private val embedHandler: Handler <String > = stringHandler()
527528
528529 override fun getEmbedHtml (
529530 params : CardGetEmbedHtmlParams ,
@@ -549,7 +550,7 @@ class CardServiceImpl internal constructor(private val clientOptions: ClientOpti
549550 .putHeader(" Accept" , " text/html" )
550551 .build()
551552 return clientOptions.httpClient.execute(request, requestOptions).let { response ->
552- response.let { embedHandler.handle(it) }
553+ errorHandler.handle( response) .let { embedHandler.handle(it) }
553554 }
554555 }
555556
Original file line number Diff line number Diff line change 33package com.lithic.api.services.blocking
44
55import com.lithic.api.core.ClientOptions
6+ import com.lithic.api.core.JsonValue
67import com.lithic.api.core.RequestOptions
78import com.lithic.api.core.checkRequired
89import com.lithic.api.core.handlers.emptyHandler
9-
1010import com.lithic.api.core.handlers.errorBodyHandler
1111import com.lithic.api.core.handlers.errorHandler
1212import com.lithic.api.core.handlers.jsonHandler
You can’t perform that action at this time.
0 commit comments