Skip to content

Commit

Permalink
unhandled exception that should have been handled is now handled
Browse files Browse the repository at this point in the history
  • Loading branch information
Steanky committed Jun 10, 2023
1 parent d238a8c commit cbe2326
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = "com.github.steanky"
version = "0.14.1"
version = "0.14.2"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,15 @@ default <TElement> TElement provide(final @NotNull Consumer<? super ElementExcep
Objects.requireNonNull(collectionSupplier);
Objects.requireNonNull(exceptionHandler);

final ConfigList listElement = listPath.followList(root());
final ConfigList listElement;
try {
listElement = listPath.followList(root());
}
catch (ElementException e) {
exceptionHandler.accept(e);
return collectionSupplier.apply(0);
}

final TCollection elementCollection = collectionSupplier.apply(listElement.size());

ElementException exception = null;
Expand Down Expand Up @@ -421,7 +429,15 @@ default <TElement> TElement provide(final @NotNull Consumer<? super ElementExcep
Objects.requireNonNull(mapSupplier);
Objects.requireNonNull(exceptionHandler);

final ConfigNode nodeElement = nodePath.followNode(root());
final ConfigNode nodeElement;
try {
nodeElement = nodePath.followNode(root());
}
catch (ElementException e) {
exceptionHandler.accept(e);
return mapSupplier.apply(0);
}

final TMap elementMap = mapSupplier.apply(nodeElement.size());

ElementException exception = null;
Expand Down

0 comments on commit cbe2326

Please sign in to comment.