Skip to content

Commit

Permalink
Added comments if libzim throw exception for articleCount and mediaCo…
Browse files Browse the repository at this point in the history
…unt this will necessary to catch the all exception thrown by libzim to prevent the aborting of the rendering process of other zim files.
  • Loading branch information
MohitMaliDeveloper authored and kelson42 committed May 3, 2024
1 parent 0866e5e commit cd64806
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,18 @@ class ZimFileReader constructor(
private val mediaCount: Int?
get() = try {
jniKiwixReader.mediaCount
} catch (ignore: Exception) {
}
// catch all exceptions to prevent the aborting of the rendering process of other zim files.
catch (ignore: Exception) {
Log.e(TAG, "Unable to find the media count $ignore")
null
}
private val articleCount: Int?
get() = try {
jniKiwixReader.articleCount
} catch (ignore: Exception) {
}
// catch all exceptions to prevent the aborting of the rendering process of other zim files.
catch (ignore: Exception) {
Log.e(TAG, "Unable to find the article count $ignore")
null
}
Expand Down

0 comments on commit cd64806

Please sign in to comment.