mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
added IOException and reverted detekt_baseline
This commit is contained in:
parent
1eaa909e59
commit
4f488f62d2
@ -53,7 +53,6 @@
|
|||||||
<ID>ReturnCount:OnSwipeTouchListener.kt$OnSwipeTouchListener.GestureListener$override fun onFling( e1: MotionEvent, e2: MotionEvent, velocityX: Float, velocityY: Float ): Boolean</ID>
|
<ID>ReturnCount:OnSwipeTouchListener.kt$OnSwipeTouchListener.GestureListener$override fun onFling( e1: MotionEvent, e2: MotionEvent, velocityX: Float, velocityY: Float ): Boolean</ID>
|
||||||
<ID>ReturnCount:ToolbarScrollingKiwixWebView.kt$ToolbarScrollingKiwixWebView$@SuppressLint("ClickableViewAccessibility") override fun onTouchEvent(event: MotionEvent): Boolean</ID>
|
<ID>ReturnCount:ToolbarScrollingKiwixWebView.kt$ToolbarScrollingKiwixWebView$@SuppressLint("ClickableViewAccessibility") override fun onTouchEvent(event: MotionEvent): Boolean</ID>
|
||||||
<ID>TooGenericExceptionCaught:CompatFindActionModeCallback.kt$CompatFindActionModeCallback$exception: Exception</ID>
|
<ID>TooGenericExceptionCaught:CompatFindActionModeCallback.kt$CompatFindActionModeCallback$exception: Exception</ID>
|
||||||
<ID>TooGenericExceptionCaught:FileReader.kt$e: Exception</ID>
|
|
||||||
<ID>TooGenericExceptionCaught:JNIInitialiser.kt$JNIInitialiser$e: Exception</ID>
|
<ID>TooGenericExceptionCaught:JNIInitialiser.kt$JNIInitialiser$e: Exception</ID>
|
||||||
<ID>TooGenericExceptionCaught:OnSwipeTouchListener.kt$OnSwipeTouchListener.GestureListener$exception: Exception</ID>
|
<ID>TooGenericExceptionCaught:OnSwipeTouchListener.kt$OnSwipeTouchListener.GestureListener$exception: Exception</ID>
|
||||||
<ID>TooGenericExceptionThrown:AdapterDelegateManager.kt$AdapterDelegateManager$throw RuntimeException("No delegate registered for $item")</ID>
|
<ID>TooGenericExceptionThrown:AdapterDelegateManager.kt$AdapterDelegateManager$throw RuntimeException("No delegate registered for $item")</ID>
|
||||||
|
@ -21,11 +21,12 @@ package org.kiwix.kiwixmobile.core.main
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import java.io.BufferedReader
|
import java.io.BufferedReader
|
||||||
|
import java.io.IOException
|
||||||
|
|
||||||
fun Context.readFile(filePath: String): String = try {
|
fun Context.readFile(filePath: String): String = try {
|
||||||
this.assets.open(filePath)
|
this.assets.open(filePath)
|
||||||
.bufferedReader()
|
.bufferedReader()
|
||||||
.use(BufferedReader::readText)
|
.use(BufferedReader::readText)
|
||||||
} catch (e: Exception) {
|
} catch (e: IOException) {
|
||||||
"".also { e.printStackTrace() }
|
"".also { e.printStackTrace() }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user