Skip to content

Commit

Permalink
(fix) exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Sep 19, 2020
1 parent 5a4f1e4 commit 31c36ef
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
public class DotenvReader {
private final String directory;
private final String filename;

public DotenvReader(String directory, String filename) {
this.directory = directory;
this.filename = filename;
Expand Down Expand Up @@ -42,8 +43,8 @@ public List<String> read() throws DotenvException, IOException {
.collect(Collectors.toList());
} catch (DotenvException e) {
var cwd = FileSystems.getDefault().getPath(".").toAbsolutePath().normalize();
var cwdMessage = !path.isAbsolute() ? "(working directory: " +cwd+ ")" : "";
e.addSuppressed(new DotenvException("Could not find $path on the file system " +cwdMessage));
var cwdMessage = !path.isAbsolute() ? "(working directory: " + cwd + ")" : "";
e.addSuppressed(new DotenvException("Could not find " + path + " on the file system " + cwdMessage));
throw e;
}
}
Expand Down

0 comments on commit 31c36ef

Please sign in to comment.