Skip to content

Commit da3d051

Browse files
authored
🔀 Merge pull request #76 from davep/fix-api
Tweak the API exception handling
2 parents 8810a42 + 2cab2eb commit da3d051

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/peplum/peps/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async def _get(self, url: str) -> Response:
4949
The response.
5050
5151
Raises:
52-
RequestError: If there was some sort of error.
52+
API.RequestError: If there was some sort of error.
5353
"""
5454
try:
5555
response = await self._client.get(url, headers={"user-agent": self.AGENT})
@@ -70,7 +70,7 @@ async def get_peps(self) -> dict[int, dict[str, Any]]:
7070
The PEP JSON data.
7171
7272
Raises:
73-
RequestError: If there was a problem getting the PEPS.
73+
API.RequestError: If there was a problem getting the PEPS.
7474
"""
7575
if isinstance(
7676
raw_data := (
@@ -79,7 +79,7 @@ async def get_peps(self) -> dict[int, dict[str, Any]]:
7979
dict,
8080
):
8181
return raw_data
82-
raise RequestError("Unexpected data received from the PEP API")
82+
raise self.RequestError("Unexpected data received from the PEP API")
8383

8484
@staticmethod
8585
def pep_file(pep: int) -> Path:

0 commit comments

Comments
 (0)