🎨 🔊 log string leading to exception next
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 8 Jun 2023 16:01:33 +0000 (18:01 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 8 Jun 2023 16:03:00 +0000 (18:03 +0200)
src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt

index fd3d8c8..e497fdc 100644 (file)
@@ -104,7 +104,7 @@ class DefaultElementLoader(private val freenetInterface: FreenetInterface, ticke
 
 }
 
-private fun String.decode() = URLDecoder.decode(this, "UTF-8")!!
+private fun String.decode() = try { URLDecoder.decode(this, "UTF-8")!! } catch (e: RuntimeException) { freenet.support.Logger.error(DefaultElementLoader::class.java, "Could not decode %s!".format(this), e); throw e }
 private fun String.normalize() = Normalizer.normalize(this, Normalizer.Form.NFC)!!
 private val String?.emptyToNull get() = if (this == "") null else this