Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add log for url on retry failure #613

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codecov_cli/helpers/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def wrapper(*args, **kwargs):
)
sleep(backoff_time(retry))
retry += 1
raise Exception("Request failed after too many retries")
raise Exception(f"Request failed after too many retries. URL: {kwargs.get('url', args[0] if args else 'Unknown')}")

return wrapper

Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_request_retry_too_many_errors(mocker):
)
with pytest.raises(Exception) as exp:
_ = send_post_request("my_url")
assert str(exp.value) == "Request failed after too many retries"
assert str(exp.value) == "Request failed after too many retries. URL: my_url"


def test_user_agent(mocker):
Expand Down
1 change: 0 additions & 1 deletion tests/helpers/test_upload_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ def test_upload_sender_result_fail_post_500s(
matcher = re.compile(
rf"(warning.*((Response status code was {error_code})|(Request failed\. Retrying)).*(\n)?){{6}}"
)

assert matcher.match(capsys.readouterr().err) is not None

def test_upload_sender_result_fail_put_400(
Expand Down
Loading