Skip to content

Commit

Permalink
Improve exception message when trying to load an old history file, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Oct 10, 2017
1 parent d2b81e3 commit 27346d0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public void load() throws IOException {
internalClear();
reader.lines().forEach(l -> {
int idx = l.indexOf(':');
if (idx < 0) {
throw new IllegalArgumentException("Bad history file syntax! " +
"The history file `" + path + "` may be an older history: " +
"please remove it or use a different history file.");
}
Instant time = Instant.ofEpochMilli(Long.parseLong(l.substring(0, idx)));
String line = unescape(l.substring(idx + 1));
internalAdd(time, line);
Expand Down

0 comments on commit 27346d0

Please sign in to comment.