Skip to content

Commit

Permalink
Report MalformedInputException to BugSnag
Browse files Browse the repository at this point in the history
Just logging this, so that I am aware of potentially what charsets are causing this issue.
  • Loading branch information
msasikanth committed Feb 15, 2024
1 parent a462c19 commit 59a01f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ kotlin {
implementation(libs.ksoup)
implementation(libs.ktxml)
implementation(libs.kermit)
implementation(libs.crashkios.bugsnag)
}
commonTest.dependencies { implementation(libs.kotlin.test) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/
package dev.sasikanth.rss.reader.core.network.parser

import co.touchlab.crashkios.bugsnag.BugsnagKotlin
import com.fleeksoft.ksoup.Ksoup
import io.ktor.utils.io.charsets.MalformedInputException

internal object HtmlContentParser {

Expand Down Expand Up @@ -47,6 +49,9 @@ internal object HtmlContentParser {
HtmlContent(imageUrl = imageUrl, content = contentStringBuilder.toString())
} catch (e: Exception) {
null
} catch (e: MalformedInputException) {
BugsnagKotlin.sendHandledException(e)
null
}
}

Expand Down

0 comments on commit 59a01f5

Please sign in to comment.