Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Supressed detekt complain
Browse files Browse the repository at this point in the history
  • Loading branch information
kidinov committed Jan 28, 2025
1 parent c3ba275 commit b04c5ae
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,13 @@ class InPersonPaymentsRestClient @Inject constructor(
)
}

fun VolleyError.getExtraData(): Map<String, Any>? {
@Suppress("TooGenericExceptionCaught")
private fun VolleyError.getExtraData(): Map<String, Any>? {
val jsonString = this.networkResponse?.data?.toString(Charsets.UTF_8)
return try {
val mapType = object : TypeToken<Map<String, Any>>() {}.type
return gson.fromJson<Map<String, Any>>(jsonString, mapType)["data"] as Map<String, Any>?
} catch (e: Exception) {
} catch (e: Throwable) {
AppLog.e(AppLog.T.API, "Error parsing volley error $jsonString", e)
null
}
Expand Down

0 comments on commit b04c5ae

Please sign in to comment.