Skip to content

Commit

Permalink
smarter error source tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 27, 2018
1 parent 844235c commit 5c6ace5
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -8,6 +8,7 @@
import net.aufdemrand.denizencore.objects.dObject;
import net.aufdemrand.denizencore.objects.dScript;
import net.aufdemrand.denizencore.scripts.ScriptEntry;
import net.aufdemrand.denizencore.scripts.commands.CommandExecuter;
import net.aufdemrand.denizencore.scripts.queues.ScriptQueue;
import net.aufdemrand.denizencore.tags.TagManager;
import net.aufdemrand.denizencore.utilities.debugging.Debuggable;
Expand Down Expand Up @@ -225,6 +226,9 @@ public static void echoError(String message) {
}

public static void echoError(ScriptQueue source, String message) {
if (source == null) {
source = CommandExecuter.currentQueue;
}
dScript script = null;
if (source != null && source.getEntries().size() > 0 && source.getEntries().get(0).getScript() != null) {
script = source.getEntries().get(0).getScript();
Expand Down Expand Up @@ -297,6 +301,9 @@ public static void echoError(Throwable ex) {
}

public static void echoError(ScriptQueue source, Throwable ex) {
if (source == null) {
source = CommandExecuter.currentQueue;
}
if (ThrowErrorEvent) {
ThrowErrorEvent = false;
Map<String, dObject> context = new HashMap<String, dObject>();
Expand Down

0 comments on commit 5c6ace5

Please sign in to comment.