Skip to content

Commit eac3d5b

Browse files
committed
update docs and raise condition for raise_for_status
1 parent 900faf3 commit eac3d5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/py/pyodide/http.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def _raise_if_failed(self) -> None:
216216
raise BodyUsedError
217217

218218
def raise_for_status(self) -> None:
219-
"""Raise an :py:exc:`OSError` if the status of the response is an error (4xx or 5xx)"""
220-
if 400 <= self.status < 600:
219+
"""Raise an :py:class:`HttpStatusError` if the status of the response is an error (400 or more.)"""
220+
if 400 <= self.status:
221221
raise HttpStatusError(self.status, self.status_text, self.url)
222222

223223
def clone(self) -> "FetchResponse":

0 commit comments

Comments
 (0)