Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
17b58d00d8
This was a useless exception wrapper that ends up making stack traces harder to read as well as the JVM cutting off the important parts Nothing catches this exception, so its safe to just get rid of it and let the REAL exception bubble down
30 Zeilen
825 B
Diff
30 Zeilen
825 B
Diff
From d7927f758fcbaeb1c2bf4fa4debed90eb6f04991 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Sat, 23 Feb 2019 11:26:21 -0500
|
|
Subject: [PATCH] Paper Utils
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java
|
|
new file mode 100644
|
|
index 00000000..e5850967
|
|
--- /dev/null
|
|
+++ b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java
|
|
@@ -0,0 +1,14 @@
|
|
+package com.destroystokyo.paper.util;
|
|
+
|
|
+public class SneakyThrow {
|
|
+
|
|
+ public static void sneaky(Throwable exception) {
|
|
+ SneakyThrow.<RuntimeException>throwSneaky(exception);
|
|
+ }
|
|
+
|
|
+ @SuppressWarnings("unchecked")
|
|
+ private static <T extends Throwable> void throwSneaky(Throwable exception) throws T {
|
|
+ throw (T) exception;
|
|
+ }
|
|
+
|
|
+}
|
|
--
|
|
2.20.1
|
|
|