Kotlin: Remove a throw statement

We have a way to carry on here, so we may as well do so
This commit is contained in:
Ian Lynagh
2022-09-13 13:51:00 +01:00
parent bc7fcaa06f
commit 2f8151d8d2

View File

@@ -354,7 +354,12 @@ private fun getTrapFileWriter(compression: Compression, logger: FileLogger, trap
return when (compression) {
Compression.NONE -> NonCompressedTrapFileWriter(logger, trapFileName)
Compression.GZIP -> GZipCompressedTrapFileWriter(logger, trapFileName)
Compression.BROTLI -> throw Exception("Brotli compression is not supported by the Kotlin extractor")
Compression.BROTLI -> {
// Brotli should have been replaced with gzip earlier, but
// if we somehow manage to get here then keep going
logger.error("Impossible Brotli compression requested. Using Gzip instead.")
getTrapFileWriter(Compression.GZIP, logger, trapFileName)
}
}
}