mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
style: fix string quotes and line wrapping in error URL handling
This commit is contained in:
parent
98bf9bd26d
commit
de65d86122
1 changed files with 5 additions and 2 deletions
|
@ -1139,11 +1139,14 @@ class Coder:
|
||||||
retry_delay *= 2
|
retry_delay *= 2
|
||||||
if retry_delay > RETRY_TIMEOUT:
|
if retry_delay > RETRY_TIMEOUT:
|
||||||
# Check for URLs in error message
|
# Check for URLs in error message
|
||||||
url_pattern = re.compile(r'(https?://[^\s/$.?#].[^\s]*[^\s,.])')
|
url_pattern = re.compile(r"(https?://[^\s/$.?#].[^\s]*[^\s,.])")
|
||||||
urls = url_pattern.findall(str(err))
|
urls = url_pattern.findall(str(err))
|
||||||
for url in urls:
|
for url in urls:
|
||||||
if self.io.confirm_ask("View this URL from the error message?", subject=url):
|
if self.io.confirm_ask(
|
||||||
|
"View this URL from the error message?", subject=url
|
||||||
|
):
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
|
||||||
webbrowser.open(url)
|
webbrowser.open(url)
|
||||||
break
|
break
|
||||||
self.io.tool_output(f"Retrying in {retry_delay:.1f} seconds...")
|
self.io.tool_output(f"Retrying in {retry_delay:.1f} seconds...")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue