diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-10-09 22:29:01 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-10-09 22:29:01 +0800 |
| commit | 53212cf188c3fa215ac1158c2a30c9036672836e (patch) | |
| tree | 4f50f8a0d30914ac3c59e5b0ea3d0042a7eb6352 /runtime/src/main/java | |
| parent | 78fd5ba12d30dcebd766000c995c218a3648d90a (diff) | |
| download | RoughlyEnoughItems-53212cf188c3fa215ac1158c2a30c9036672836e.tar.gz RoughlyEnoughItems-53212cf188c3fa215ac1158c2a30c9036672836e.tar.bz2 RoughlyEnoughItems-53212cf188c3fa215ac1158c2a30c9036672836e.zip | |
Make SearchProviderImpl crash with more details
Diffstat (limited to 'runtime/src/main/java')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/client/search/SearchProviderImpl.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/search/SearchProviderImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/search/SearchProviderImpl.java index 530bfa266..0112ca363 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/search/SearchProviderImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/search/SearchProviderImpl.java @@ -28,6 +28,9 @@ import me.shedaniel.rei.api.client.search.SearchProvider; import me.shedaniel.rei.api.common.entry.EntryStack; import me.shedaniel.rei.impl.client.search.argument.Argument; import me.shedaniel.rei.impl.client.search.argument.CompoundArgument; +import me.shedaniel.rei.impl.client.util.CrashReportUtils; +import net.minecraft.CrashReport; +import net.minecraft.CrashReportCategory; import java.util.List; import java.util.Objects; @@ -54,7 +57,18 @@ public class SearchProviderImpl implements SearchProvider { @Override public boolean test(EntryStack<?> stack) { - return Argument.matches(stack, arguments); + try { + return Argument.matches(stack, arguments); + } catch (Throwable throwable) { + CrashReport report = CrashReportUtils.essential(throwable, "Testing entry with search filter"); + CrashReportCategory category = report.addCategory("Search entry details"); + try { + stack.fillCrashReport(report, category); + } catch (Throwable throwable1) { + category.setDetailError("Filling Report", throwable1); + } + throw CrashReportUtils.throwReport(report); + } } @Override |
