Skip to content

Commit 6fa2fa6

Browse files
committed
fix: Improve clarity of download error messages
The messages are cute, but some people might not understand what "your file is in another castle" means, or what the awkward phrase "log into browser to download one" means. ;)
1 parent d1ef6a1 commit 6fa2fa6

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

comfy_cli/file_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def parse_json(input_data):
3737
if msg_json is not None:
3838
if "message" in msg_json:
3939
return f"Unauthorized download ({status_code}).\n{msg_json['message']}\nor you can set civitai api token using `comfy model download --set-civitai-api-token <token>`"
40-
return f"Unauthorized download ({status_code}), you might need to manually log into browser to download one"
40+
return f"Unauthorized download ({status_code}), you might need to manually log into a browser to download this"
4141
elif status_code == 403:
42-
return f"Forbidden url ({status_code}), you might need to manually log into browser to download one"
42+
return f"Forbidden url ({status_code}), you might need to manually log into a browser to download this"
4343
elif status_code == 404:
44-
return "Sorry, your file is in another castle (404)"
44+
return "File not found on server (404)"
4545
return f"Unknown error occurred (status code: {status_code})"
4646

4747

tests/test_file_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_guess_status_code_reason_401_with_json():
2525
def test_guess_status_code_reason_401_without_json():
2626
result = guess_status_code_reason(401, "not json")
2727
assert "Unauthorized download (401)" in result
28-
assert "manually log into browser" in result
28+
assert "manually log into a browser" in result
2929

3030

3131
def test_guess_status_code_reason_403():
@@ -35,7 +35,7 @@ def test_guess_status_code_reason_403():
3535

3636
def test_guess_status_code_reason_404():
3737
result = guess_status_code_reason(404, "")
38-
assert "another castle (404)" in result
38+
assert "not found on server (404)" in result
3939

4040

4141
def test_guess_status_code_reason_unknown():

0 commit comments

Comments
 (0)