Skip to content

Commit

Permalink
Catch Exception instead of only IllegalArgumentException when decodin…
Browse files Browse the repository at this point in the history
…g paywallData (#1601)

We have a customer having a silent crash here. I am changing it to catch
everything to get more insights
  • Loading branch information
vegaro committed Feb 6, 2024
1 parent 6e5b6b8 commit 5e5f17b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ internal abstract class OfferingParser {

val paywallDataJson = offeringJson.optJSONObject("paywall")

@Suppress("TooGenericExceptionCaught")
val paywallData: PaywallData? = paywallDataJson?.let {
try {
json.decodeFromString<PaywallData>(it.toString())
} catch (e: IllegalArgumentException) {
} catch (e: Exception) {
errorLog("Error deserializing paywall data", e)
null
}
Expand Down

0 comments on commit 5e5f17b

Please sign in to comment.