#163 Make NBIO file read errors more helpful

This commit is contained in:
Jonathan Shook 2020-06-17 13:36:43 -05:00
parent cb7d9d161a
commit 244217c6a7

View File

@ -89,7 +89,9 @@ public class NBIO implements NBPathsAPI.Facets {
public static Path getFirstLocalPath(String... potentials) {
Optional<Content<?>> first = NBIO.local().name(potentials).first();
return first.orElseThrow().asPath();
return first.orElseThrow(
() -> new BasicError("Unable to find loadable content at " + String.join(",",potentials))
).asPath();
}
public static Optional<Path> findFirstLocalPath(String... potentials) {