Skip to content

Commit fc2e7a9

Browse files
committed
Updated error message when invalid persistent history file is read
1 parent d0b69ec commit fc2e7a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd2/cmd2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4484,7 +4484,10 @@ def _initialize_history(self, hist_file: str) -> None:
44844484
self.perror(f"Cannot read persistent history file '{hist_file}': {ex}")
44854485
return
44864486
except (json.JSONDecodeError, lzma.LZMAError, KeyError, UnicodeDecodeError, ValueError) as ex:
4487-
self.perror(f"Error processing persistent history file '{hist_file}': {ex}")
4487+
self.perror(
4488+
f"Error processing persistent history file '{hist_file}': {ex}\n"
4489+
f"The history file will be recreated when this application exits."
4490+
)
44884491

44894492
self.history.start_session()
44904493
self.persistent_history_file = hist_file

0 commit comments

Comments
 (0)