Skip to content

Commit

Permalink
fix: catch exception if history file fails to load for any reason
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Oct 7, 2024
1 parent 5081c89 commit d832c9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gptme/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def _load_readline_history() -> None: # pragma: no cover
except FileNotFoundError:
for line in history_examples:
readline.add_history(line)
except:
logger.exception("Failed to load history file")

atexit.register(readline.write_history_file, history_file)

Expand Down

0 comments on commit d832c9c

Please sign in to comment.