mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Remove stack trace cleaning, didn't actually remove unwanted elements.
This commit is contained in:
parent
8da3b490d9
commit
3cc1a462f5
1 changed files with 3 additions and 15 deletions
|
@ -42,6 +42,7 @@ import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
@ -241,7 +242,7 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||||
getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100);
|
getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100);
|
||||||
Economy.setEss(this);
|
Economy.setEss(this);
|
||||||
execTimer.mark("RegListeners");
|
execTimer.mark("RegListeners");
|
||||||
|
|
||||||
final MetricsStarter metricsStarter = new MetricsStarter(this);
|
final MetricsStarter metricsStarter = new MetricsStarter(this);
|
||||||
if (metricsStarter.getStart() != null && metricsStarter.getStart() == true)
|
if (metricsStarter.getStart() != null && metricsStarter.getStart() == true)
|
||||||
{
|
{
|
||||||
|
@ -304,20 +305,7 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||||
}
|
}
|
||||||
catch (final Exception ex)
|
catch (final Exception ex)
|
||||||
{
|
{
|
||||||
final ArrayList<StackTraceElement> elements = new ArrayList<StackTraceElement>(Arrays.asList(ex.getStackTrace()));
|
Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||||
elements.remove(0);
|
|
||||||
final ArrayList<StackTraceElement> toRemove = new ArrayList<StackTraceElement>();
|
|
||||||
for (final StackTraceElement e : elements)
|
|
||||||
{
|
|
||||||
if (e.getClassName().equals("com.earth2me.essentials.Essentials"))
|
|
||||||
{
|
|
||||||
toRemove.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elements.removeAll(toRemove);
|
|
||||||
final StackTraceElement[] trace = elements.toArray(new StackTraceElement[elements.size()]);
|
|
||||||
ex.setStackTrace(trace);
|
|
||||||
ex.printStackTrace();
|
|
||||||
sender.sendMessage(ChatColor.RED + "An internal error occurred while attempting to perform this command");
|
sender.sendMessage(ChatColor.RED + "An internal error occurred while attempting to perform this command");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue