From 8e43911a636d8170d59926bda5cb59a45515c5d1 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 17 Aug 2024 06:47:05 -0700 Subject: [PATCH] fix: Move if statement out of try block in aider/main.py --- aider/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/aider/main.py b/aider/main.py index b5045cfe8..0f73897fd 100644 --- a/aider/main.py +++ b/aider/main.py @@ -507,10 +507,10 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F args.max_chat_history_tokens or main_model.max_chat_history_tokens, ) - try: - if args.cache_prompts: - args.map_refresh = "files" + if args.cache_prompts: + args.map_refresh = "files" + try: coder = Coder.create( main_model=main_model, edit_format=args.edit_format, @@ -538,7 +538,6 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F map_refresh=args.map_refresh, cache_prompts=args.cache_prompts, ) - except ValueError as err: io.tool_error(str(err)) return 1