1
0

[MINOR] Expose the detailed exception object (#2861)

This commit is contained in:
vinoyang
2021-04-21 22:41:42 +08:00
committed by GitHub
parent cc81ddde01
commit c24d90d25a

View File

@@ -36,6 +36,10 @@ public class TableNotFoundException extends HoodieException {
super(getErrorMessage(basePath)); super(getErrorMessage(basePath));
} }
public TableNotFoundException(String basePath, Throwable t) {
super(getErrorMessage(basePath), t);
}
private static String getErrorMessage(String basePath) { private static String getErrorMessage(String basePath) {
return "Hoodie table not found in path " + basePath; return "Hoodie table not found in path " + basePath;
} }
@@ -50,7 +54,7 @@ public class TableNotFoundException extends HoodieException {
} }
} catch (FileNotFoundException | IllegalArgumentException e) { } catch (FileNotFoundException | IllegalArgumentException e) {
// if the base path is file:///, then we have a IllegalArgumentException // 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) { } catch (IOException e) {
throw new HoodieIOException("Could not check if " + basePathDir + " is a valid table", e); throw new HoodieIOException("Could not check if " + basePathDir + " is a valid table", e);
} }