Log a warning in CacheImporter if a group is corrupt

Signed-off-by: Graham <gpe@openrs2.org>
Graham 4 years ago
parent e1f1da1cc0
commit 8eb1f82048
  1. 4
      archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt

@ -1,5 +1,6 @@
package org.openrs2.archive.cache package org.openrs2.archive.cache
import com.github.michaelbull.logging.InlineLogger
import io.netty.buffer.ByteBuf import io.netty.buffer.ByteBuf
import io.netty.buffer.ByteBufAllocator import io.netty.buffer.ByteBufAllocator
import io.netty.buffer.ByteBufUtil import io.netty.buffer.ByteBufUtil
@ -543,6 +544,7 @@ public class CacheImporter @Inject constructor(
} }
} }
} catch (ex: IOException) { } catch (ex: IOException) {
logger.warn(ex) { "Skipping corrupt group (archive $archive, group $group)" }
return null return null
} }
} }
@ -822,6 +824,8 @@ public class CacheImporter @Inject constructor(
} }
public companion object { public companion object {
private val logger = InlineLogger()
public const val BATCH_SIZE: Int = 1024 public const val BATCH_SIZE: Int = 1024
} }
} }

Loading…
Cancel
Save