Skip to content

Commit de1a2b4

Browse files
committed
Just put message
1 parent db68698 commit de1a2b4

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

src/py/pyodide/http.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ def __init__(self, status: int, status_text: str, url: str) -> None:
4040
super().__init__(f"{status} Client Error: {status_text} for url: {url}")
4141
elif 500 <= status < 600:
4242
super().__init__(f"{status} Server Error: {status_text} for url: {url}")
43-
raise ValueError(
44-
f"Invalid error code not comprised between 400 and 599: {status}"
45-
)
43+
else:
44+
super().__init__(
45+
f"{status} Invalid error code not comprised between 400 and 599: {status_text} for url: {url}"
46+
)
4647

4748

4849
class BodyUsedError(OSError):

src/tests/test_pyodide_http.py

-16
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,6 @@ async def test_pyfetch_raise_for_status_does_not_raise_200(
112112
assert error_504.value.status_text == "GATEWAY TIMEOUT"
113113
assert error_504.value.url.endswith("status_504")
114114

115-
116-
@run_in_pyodide
117-
async def cant_create_invalid_HttpStatusErrors(selenium):
118-
from pyodide.http import HttpStatusError
119-
120-
with pytest.raises(
121-
ValueError, match="Invalid error code not comprised between 400 and 599"
122-
):
123-
HttpStatusError(200, "Can't raise a success error code")
124-
125-
with pytest.raises(
126-
ValueError, match="Invalid error code not comprised between 400 and 599"
127-
):
128-
HttpStatusError(999, "Can't raise an unknown error code")
129-
130-
131115
@run_in_pyodide
132116
async def test_pyfetch_unpack_archive(selenium):
133117
import pathlib

0 commit comments

Comments
 (0)