Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mwapi/async_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ async def _request(self, method, params=None, auth=None):
raise ConnectionError(str(e)) from e
except aiohttp.TooManyRedirects as e:
raise TooManyRedirectsError(str(e)) from e
except APIError:
# Raised above for a JSON 'error' response. Let it propagate with its
# structured .code/.info/.content instead of re-wrapping as RequestError
# below (matches the synchronous Session, which raises it uncaught).
raise
except Exception as e:
raise RequestError(str(e)) from e

Expand Down