mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
feat: add error handling for 'yes:' config issue
This commit is contained in:
parent
96cdd95988
commit
f82ab9cc6e
1 changed files with 29 additions and 2 deletions
|
@ -372,13 +372,40 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||||
default_config_files.reverse()
|
default_config_files.reverse()
|
||||||
|
|
||||||
parser = get_parser(default_config_files, git_root)
|
parser = get_parser(default_config_files, git_root)
|
||||||
args, unknown = parser.parse_known_args(argv)
|
|
||||||
|
try:
|
||||||
|
args, unknown = parser.parse_known_args(argv)
|
||||||
|
except AttributeError as e:
|
||||||
|
if "'bool' object has no attribute 'strip'" in str(e):
|
||||||
|
io.tool_error("Configuration error detected.")
|
||||||
|
io.tool_output("It seems you have 'yes:' in one of your configuration files.")
|
||||||
|
io.tool_output("Please replace 'yes:' with 'yes-always:' in the relevant .aider.conf.yml file.")
|
||||||
|
io.tool_output("Configuration files are searched for in this order:")
|
||||||
|
for config_file in default_config_files:
|
||||||
|
io.tool_output(f" - {config_file}")
|
||||||
|
io.tool_output("For more information, refer to the aider documentation on configuration.")
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
# Load the .env file specified in the arguments
|
# Load the .env file specified in the arguments
|
||||||
loaded_dotenvs = load_dotenv_files(git_root, args.env_file, args.encoding)
|
loaded_dotenvs = load_dotenv_files(git_root, args.env_file, args.encoding)
|
||||||
|
|
||||||
# Parse again to include any arguments that might have been defined in .env
|
# Parse again to include any arguments that might have been defined in .env
|
||||||
args = parser.parse_args(argv)
|
try:
|
||||||
|
args = parser.parse_args(argv)
|
||||||
|
except AttributeError as e:
|
||||||
|
if "'bool' object has no attribute 'strip'" in str(e):
|
||||||
|
io.tool_error("Configuration error detected.")
|
||||||
|
io.tool_output("It seems you have 'yes:' in one of your configuration files.")
|
||||||
|
io.tool_output("Please replace 'yes:' with 'yes-always:' in the relevant .aider.conf.yml file.")
|
||||||
|
io.tool_output("Configuration files are searched for in this order:")
|
||||||
|
for config_file in default_config_files:
|
||||||
|
io.tool_output(f" - {config_file}")
|
||||||
|
io.tool_output("For more information, refer to the aider documentation on configuration.")
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
if not args.verify_ssl:
|
if not args.verify_ssl:
|
||||||
import httpx
|
import httpx
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue