Skip to content

Commit

Permalink
Expect either NoSuchFileException in loadResourceFromModFile (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt authored Dec 1, 2023
1 parent a43f00e commit 198f30c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import net.neoforged.neoforgespi.locating.ModFileLoadingException;
import org.slf4j.Logger;

import java.io.FileNotFoundException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.util.Optional;

Expand All @@ -25,8 +25,8 @@ protected Optional<InputStream> loadResourceFromModFile(final IModFile modFile,
try {
return Optional.of(Files.newInputStream(modFile.findResource(path.toString())));
}
catch (final FileNotFoundException e) {
LOGGER.debug("Failed to load resource {} from {}, it does not contain dependency information.", path, modFile.getFileName());
catch (final NoSuchFileException e) {
LOGGER.trace("Failed to load resource {} from {}, it does not contain dependency information.", path, modFile.getFileName());
return Optional.empty();
}
catch (final Exception e) {
Expand Down

0 comments on commit 198f30c

Please sign in to comment.