Skip to content

Commit

Permalink
Core: FileIO Reflection Error Message is Misleading (apache#9840)
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellSpitzer authored Feb 29, 2024
1 parent acbf96f commit 08e31ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/apache/iceberg/CatalogUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public static FileIO loadFileIO(String impl, Map<String, String> properties, Obj
.buildChecked();
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException(
String.format("Cannot initialize FileIO, missing no-arg constructor: %s", impl), e);
String.format("Cannot initialize FileIO implementation %s: %s", impl, e.getMessage()), e);
}

FileIO fileIO;
Expand Down
4 changes: 3 additions & 1 deletion core/src/test/java/org/apache/iceberg/TestCatalogUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ public void loadCustomFileIO_badArg() {
Assertions.assertThatThrownBy(
() -> CatalogUtil.loadFileIO(TestFileIOBadArg.class.getName(), Maps.newHashMap(), null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageStartingWith("Cannot initialize FileIO, missing no-arg constructor");
.hasMessageStartingWith(
"Cannot initialize FileIO implementation "
+ "org.apache.iceberg.TestCatalogUtil$TestFileIOBadArg: Cannot find constructor");
}

@Test
Expand Down

0 comments on commit 08e31ce

Please sign in to comment.