Skip to content

Commit

Permalink
fix: Raise exceptions from None when re-raising
Browse files Browse the repository at this point in the history
  • Loading branch information
cetteup committed Aug 18, 2024
1 parent c105bf4 commit 30a602b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aspxstats/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ async def get_aspx_data(self, endpoint: str, params: Optional[Dict[str, Optional
except asyncio.TimeoutError:
raise TimeoutError('Timed out trying to fetch ASPX data')
except aiohttp.ClientError as e:
raise ClientError(f'Failed to fetch ASPX data: {e}')
raise ClientError(f'Failed to fetch ASPX data: {e}') from None
2 changes: 1 addition & 1 deletion aspxstats/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_aspx_data(self, endpoint: str, params: Optional[Dict[str, Optional[Union
except requests.Timeout:
raise TimeoutError('Timed out trying to fetch ASPX data')
except requests.RequestException as e:
raise ClientError(f'Failed to fetch ASPX data: {e}')
raise ClientError(f'Failed to fetch ASPX data: {e}') from None

@staticmethod
def stringify_params(
Expand Down

0 comments on commit 30a602b

Please sign in to comment.