Skip to content

Commit

Permalink
Updated error message when invalid persistent history file is read
Browse files Browse the repository at this point in the history
  • Loading branch information
kmvanbrunt committed Jun 14, 2021
1 parent d0b69ec commit fc2e7a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd2/cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc2e7a9

Please sign in to comment.