From 19c054b5b3a865a8b583c6216aaee7096188fae9 Mon Sep 17 00:00:00 2001 From: Sumeet Varma Date: Tue, 1 Oct 2024 15:11:44 -0700 Subject: [PATCH] [Spark][Kernel] Add isFatal detection to LogStoreErors (#3743) #### Which Delta project/connector is this regarding? - [x] Spark - [ ] Standalone - [ ] Flink - [x] Kernel - [ ] Other (fill in here) ## Description Simple PR that adds `isFatal` utility that can be used in `delta-storage` ## How was this patch tested? Build ## Does this PR introduce _any_ user-facing changes? No --- .../java/io/delta/storage/internal/LogStoreErrors.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/storage/src/main/java/io/delta/storage/internal/LogStoreErrors.java b/storage/src/main/java/io/delta/storage/internal/LogStoreErrors.java index 6685ce3abfb..3d2f24cad15 100644 --- a/storage/src/main/java/io/delta/storage/internal/LogStoreErrors.java +++ b/storage/src/main/java/io/delta/storage/internal/LogStoreErrors.java @@ -36,6 +36,14 @@ public static boolean isNonFatal(Throwable t) { return true; } + /** + * Returns true if the provided Throwable is to be considered fatal, or false if it is to be + * considered non-fatal + */ + public static boolean isFatal(Throwable t) { + return !isNonFatal(t); + } + public static IOException incorrectLogStoreImplementationException(Throwable cause) { return new IOException( String.join("\n",