Skip to content

Commit

Permalink
Log more info about CNFException
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Apr 8, 2023
1 parent 5daac9b commit a5731b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/src/main/java/be/mygod/librootkotlinx/RootServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,11 @@ class RootServer {

private fun DataInputStream.readSerializable(classLoader: ClassLoader?) =
object : ObjectInputStream(ByteArrayInputStream(readByteArray())) {
override fun resolveClass(desc: ObjectStreamClass) = Class.forName(desc.name, false, classLoader)
override fun resolveClass(desc: ObjectStreamClass) = try {
Class.forName(desc.name, false, classLoader)
} catch (e: ClassNotFoundException) {
throw ClassNotFoundException("$desc, $classLoader", e)
}
}.readObject()

@JvmStatic
Expand Down

0 comments on commit a5731b4

Please sign in to comment.