mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-28 05:35:28 +01:00
Don't ignore critical exceptions - print them.
This commit is contained in:
parent
1509f5cd8b
commit
3b142db569
@ -65,7 +65,7 @@ public class ProtocolLibrary extends JavaPlugin {
|
||||
private static PacketFilterManager protocolManager;
|
||||
|
||||
// Error reporter
|
||||
private ErrorReporter reporter;
|
||||
private static ErrorReporter reporter;
|
||||
|
||||
// Metrics and statistisc
|
||||
private Statistics statistisc;
|
||||
@ -353,6 +353,7 @@ public class ProtocolLibrary extends JavaPlugin {
|
||||
protocolManager.close();
|
||||
protocolManager = null;
|
||||
statistisc = null;
|
||||
reporter = null;
|
||||
|
||||
// Leaky ClassLoader begone!
|
||||
CleanupStaticMembers cleanup = new CleanupStaticMembers(getClassLoader(), reporter);
|
||||
@ -373,6 +374,14 @@ public class ProtocolLibrary extends JavaPlugin {
|
||||
return log;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the current error reporter.
|
||||
* @return Current error reporter.
|
||||
*/
|
||||
public static ErrorReporter getErrorReporter() {
|
||||
return reporter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the packet protocol manager.
|
||||
* @return Packet protocol manager, or NULL if it has been disabled.
|
||||
|
@ -23,6 +23,7 @@ import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import com.comphenix.protocol.ProtocolLibrary;
|
||||
import com.comphenix.protocol.injector.PacketConstructor.Unwrapper;
|
||||
import com.comphenix.protocol.reflect.instances.DefaultInstances;
|
||||
|
||||
@ -107,8 +108,10 @@ public class BukkitUnwrapper implements Unwrapper {
|
||||
return find;
|
||||
|
||||
} catch (SecurityException e) {
|
||||
ProtocolLibrary.getErrorReporter().reportDetailed(this, "Security limitation.", e, type);
|
||||
return null;
|
||||
} catch (NoSuchMethodException e) {
|
||||
ProtocolLibrary.getErrorReporter().reportDetailed(this, "Cannot unwrap object.", e, type);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user