#163 Make NBIO file read errors more helpful

This commit is contained in:
Jonathan Shook 2020-06-17 13:34:34 -05:00
parent 2a7406e0fa
commit cb7d9d161a

View File

@ -52,7 +52,9 @@ public class NBIO implements NBPathsAPI.Facets {
}
public static List<String> readLines(String filename) {
Content<?> data = NBIO.all().prefix("data").name(filename).first().orElseThrow();
Content<?> data = NBIO.all().prefix("data").name(filename).first().orElseThrow(
() -> new BasicError("Unable to read lines from " + filename)
);
String[] split = data.getCharBuffer().toString().split("\n");
return Arrays.asList(split);
}