added IOException and reverted detekt_baseline

This commit is contained in:
gouri-panda 2021-01-07 23:23:56 +05:30
parent 1eaa909e59
commit 4f488f62d2
2 changed files with 2 additions and 2 deletions

View File

@ -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>

View File

@ -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() }
} }