Skip to content

Commit

Permalink
Report OPML failure exceptions to BugSnag
Browse files Browse the repository at this point in the history
I am also logging the OPML being imported, so that I can reproduce the error and resolving it rather than guessing what might the issue.
  • Loading branch information
msasikanth committed Feb 15, 2024
1 parent 59a01f5 commit eeb3d96
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package dev.sasikanth.rss.reader.opml

import co.touchlab.crashkios.bugsnag.BugsnagKotlin
import co.touchlab.kermit.Logger
import co.touchlab.stately.concurrency.AtomicInt
import dev.sasikanth.rss.reader.di.scopes.AppScope
import dev.sasikanth.rss.reader.filemanager.FileManager
Expand Down Expand Up @@ -65,6 +67,7 @@ class OpmlManager(
try {
withContext(job) {
val opmlXmlContent = fileManager.read()
Logger.i { opmlXmlContent.orEmpty() }

if (!opmlXmlContent.isNullOrBlank()) {
_result.emit(OpmlResult.InProgress.Importing(0))
Expand All @@ -83,6 +86,7 @@ class OpmlManager(
return
}

BugsnagKotlin.sendHandledException(e)
_result.emit(OpmlResult.Error.UnknownFailure(e))
}
}
Expand Down Expand Up @@ -115,6 +119,7 @@ class OpmlManager(
return
}

BugsnagKotlin.sendHandledException(e)
_result.emit(OpmlResult.Error.UnknownFailure(e))
}
}
Expand Down

0 comments on commit eeb3d96

Please sign in to comment.