From fc2e7a93b02e75fd0b2a49998aa4ed33bf4a1189 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Mon, 14 Jun 2021 11:03:52 -0400 Subject: [PATCH] Updated error message when invalid persistent history file is read --- cmd2/cmd2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index de0621bf..72d93f49 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -4484,7 +4484,10 @@ def _initialize_history(self, hist_file: str) -> None: self.perror(f"Cannot read persistent history file '{hist_file}': {ex}") return except (json.JSONDecodeError, lzma.LZMAError, KeyError, UnicodeDecodeError, ValueError) as ex: - self.perror(f"Error processing persistent history file '{hist_file}': {ex}") + self.perror( + f"Error processing persistent history file '{hist_file}': {ex}\n" + f"The history file will be recreated when this application exits." + ) self.history.start_session() self.persistent_history_file = hist_file