From c24d90d25a049dc6a9e3213f2b6906c2374c0e28 Mon Sep 17 00:00:00 2001 From: vinoyang Date: Wed, 21 Apr 2021 22:41:42 +0800 Subject: [PATCH] [MINOR] Expose the detailed exception object (#2861) --- .../org/apache/hudi/exception/TableNotFoundException.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hudi-common/src/main/java/org/apache/hudi/exception/TableNotFoundException.java b/hudi-common/src/main/java/org/apache/hudi/exception/TableNotFoundException.java index 2febe51f7..fd5fe102d 100644 --- a/hudi-common/src/main/java/org/apache/hudi/exception/TableNotFoundException.java +++ b/hudi-common/src/main/java/org/apache/hudi/exception/TableNotFoundException.java @@ -36,6 +36,10 @@ public class TableNotFoundException extends HoodieException { super(getErrorMessage(basePath)); } + public TableNotFoundException(String basePath, Throwable t) { + super(getErrorMessage(basePath), t); + } + private static String getErrorMessage(String basePath) { return "Hoodie table not found in path " + basePath; } @@ -50,7 +54,7 @@ public class TableNotFoundException extends HoodieException { } } catch (FileNotFoundException | IllegalArgumentException e) { // if the base path is file:///, then we have a IllegalArgumentException - throw new TableNotFoundException(metaPathDir.toString()); + throw new TableNotFoundException(metaPathDir.toString(), e); } catch (IOException e) { throw new HoodieIOException("Could not check if " + basePathDir + " is a valid table", e); }