mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 04:05:50 -07:00
Add plugin details to zip file errors (#12580)
Helps debug classloading across plugin boundaries. Zip file errors can be thrown for multiple reasons, and they are capable of affecting other plugins' classloading.
This commit is contained in:
@@ -206,7 +206,16 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
|||||||
|
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
String path = name.replace('.', '/').concat(".class");
|
String path = name.replace('.', '/').concat(".class");
|
||||||
JarEntry entry = jar.getJarEntry(path);
|
// Add details to zip file errors - help debug classloading
|
||||||
|
JarEntry entry;
|
||||||
|
try {
|
||||||
|
entry = jar.getJarEntry(path);
|
||||||
|
} catch (IllegalStateException zipFileClosed) {
|
||||||
|
if (plugin == null) {
|
||||||
|
throw zipFileClosed;
|
||||||
|
}
|
||||||
|
throw new IllegalStateException("The plugin classloader for " + plugin.getName() + " has thrown a zip file error.", zipFileClosed);
|
||||||
|
}
|
||||||
|
|
||||||
if (entry != null) {
|
if (entry != null) {
|
||||||
byte[] classBytes;
|
byte[] classBytes;
|
||||||
|
Reference in New Issue
Block a user