More descriptive errors stacktraces

This commit is contained in:
filoghost 2019-05-30 12:08:25 +02:00
parent 87fc7bde5a
commit 2a3314c95a
26 changed files with 98 additions and 55 deletions

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_10_R1;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -269,8 +271,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_10_R1;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -238,8 +240,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_11_R1;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_11_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -245,8 +247,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_11_R1;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -223,8 +225,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_12_R1;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -245,8 +247,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_12_R1;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -223,8 +225,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_13_R1;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_13_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_13_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -245,8 +247,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_13_R1;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_13_R1.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -224,8 +226,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_13_R2;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -245,8 +247,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_13_R2;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -224,8 +226,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_14_R1;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -246,8 +248,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_14_R1;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -225,8 +227,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_8_R1;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -223,8 +225,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
try {
RIDER_PITCH_DELTA.set(this, 0.0);
RIDER_YAW_DELTA.set(this, 0.0);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set rider pitch and yaw", t);
}
if (this.vehicle != null) {

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_8_R1;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -194,8 +196,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
try {
RIDER_PITCH_DELTA.set(this, 0.0);
RIDER_YAW_DELTA.set(this, 0.0);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set rider pitch and yaw", t);
}
if (this.vehicle != null) {

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_8_R2;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import com.gmail.filoghost.holographicdisplays.api.line.HologramLine;
@ -54,8 +56,8 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
setBasePlate(true);
try {
SET_MARKER_METHOD.invoke(this, true);
} catch (Exception e) {
ConsoleLogger.logDebugException(e);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set armor stand as marker", t);
// It will still work, but the offset will be wrong.
}
this.parentPiece = parentPiece;

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_8_R2;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -223,8 +225,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
try {
RIDER_PITCH_DELTA.set(this, 0.0);
RIDER_YAW_DELTA.set(this, 0.0);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set rider pitch and yaw", t);
}
if (this.vehicle != null) {

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_8_R2;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -194,8 +196,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
try {
RIDER_PITCH_DELTA.set(this, 0.0);
RIDER_YAW_DELTA.set(this, 0.0);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set rider pitch and yaw", t);
}
if (this.vehicle != null) {

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_8_R3;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
import com.gmail.filoghost.holographicdisplays.api.line.HologramLine;
@ -54,8 +56,8 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
setBasePlate(true);
try {
SET_MARKER_METHOD.invoke(this, true);
} catch (Exception e) {
ConsoleLogger.logDebugException(e);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set armor stand as marker", t);
// It will still work, but the offset will be wrong.
}
this.parentPiece = parentPiece;

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_8_R3;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -223,8 +225,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
try {
RIDER_PITCH_DELTA.set(this, 0.0);
RIDER_YAW_DELTA.set(this, 0.0);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set rider pitch and yaw", t);
}
if (this.vehicle != null) {

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_8_R3;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -194,8 +196,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
try {
RIDER_PITCH_DELTA.set(this, 0.0);
RIDER_YAW_DELTA.set(this, 0.0);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set rider pitch and yaw", t);
}
if (this.vehicle != null) {

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_9_R1;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_9_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_9_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -268,8 +270,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_9_R1;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_9_R1.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -236,8 +238,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_9_R2;
import java.util.logging.Level;
import org.bukkit.craftbukkit.v1_9_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_9_R2.inventory.CraftItemStack;
import org.bukkit.entity.Player;
@ -269,8 +271,8 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}

View File

@ -14,6 +14,8 @@
*/
package com.gmail.filoghost.holographicdisplays.nms.v1_9_R2;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_9_R2.entity.CraftEntity;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -237,8 +239,8 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
entity.passengers.clear();
entity.passengers.add(this);
} catch (Exception ex) {
ConsoleLogger.logDebugException(ex);
} catch (Throwable t) {
ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
}
}
}

View File

@ -191,10 +191,9 @@ public class BungeeServerTracker {
displayOffline = true;
} catch (IOException e) {
displayOffline = true;
} catch (Exception e) {
} catch (Throwable t) {
displayOffline = true;
ConsoleLogger.log(Level.WARNING, "Couldn't fetch data from " + entry.getKey() + "(" + entry.getValue().toString() + "), unhandled exception: " + e.toString());
ConsoleLogger.logDebugException(e);
ConsoleLogger.log(Level.WARNING, "Couldn't fetch data from " + entry.getKey() + "(" + entry.getValue().toString() + ")", t);
}
if (displayOffline) {

View File

@ -52,10 +52,6 @@ public class ConsoleLogger {
logDebug(level, msg, null);
}
public static void logDebugException(Throwable thrown) {
thrown.printStackTrace();
}
public static void handleSpawnFail(HologramLine parentPiece) {
logDebug(Level.WARNING, "Coulnd't spawn entity for this hologram: " + parentPiece.getParent().toString());
}