Simplify nested errors
Replace incomprehensible IndexOutOfBoundsException with intelligible exception #KT-47753 Fixed
This commit is contained in:
committed by
teamcityserver
parent
afd9b4935a
commit
a4a1d35021
@@ -54,9 +54,12 @@ open class LookupStorage(
|
||||
try {
|
||||
if (countersFile.exists()) {
|
||||
val lines = countersFile.readLines()
|
||||
size = lines[0].toInt()
|
||||
size = lines.firstOrNull()?.toIntOrNull() ?: throw IOException("$countersFile exists, but it is empty. " +
|
||||
"Counters file is corrupted")
|
||||
oldSize = size
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
throw e
|
||||
} catch (e: Exception) {
|
||||
throw IOException("Could not read $countersFile", e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user