This repository was archived by the owner on Jul 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 22import uuid
33from time import sleep
44
5+ import click
56import requests
67
78from codecov_cli .types import RequestError , RequestResult
@@ -46,9 +47,11 @@ def send_post_request(
4647
4748def get_token_header_or_fail (token : uuid .UUID ) -> dict :
4849 if token is None :
49- raise Exception ("Codecov token not found." )
50+ raise click .ClickException (
51+ "Codecov token not found. Please provide Codecov token with -t flag."
52+ )
5053 if not isinstance (token , uuid .UUID ):
51- raise Exception (f"Token must be UUID. Received { type (token )} " )
54+ raise click . ClickException (f"Token must be UUID. Received { type (token )} " )
5255 return {"Authorization" : f"token { token .hex } " }
5356
5457
Original file line number Diff line number Diff line change @@ -57,7 +57,10 @@ def test_get_token_header_or_fail():
5757 with pytest .raises (Exception ) as e :
5858 get_token_header_or_fail (token )
5959
60- assert str (e .value ) == "Codecov token not found."
60+ assert (
61+ str (e .value )
62+ == "Codecov token not found. Please provide Codecov token with -t flag."
63+ )
6164
6265 # Test with an invalid token type
6366 token = "invalid_token"
You can’t perform that action at this time.
0 commit comments