mirror of
https://github.com/gogcom/galaxy-integrations-python-api.git
synced 2026-01-03 20:38:17 -05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be6c0eb03e | ||
|
|
0ee56193de |
2
setup.py
2
setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="galaxy.plugin.api",
|
name="galaxy.plugin.api",
|
||||||
version="0.29",
|
version="0.30",
|
||||||
description="Galaxy python plugin API",
|
description="Galaxy python plugin API",
|
||||||
author='Galaxy team',
|
author='Galaxy team',
|
||||||
author_email='galaxy@gog.com',
|
author_email='galaxy@gog.com',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import certifi
|
|||||||
|
|
||||||
from galaxy.api.errors import (
|
from galaxy.api.errors import (
|
||||||
AccessDenied, AuthenticationRequired,
|
AccessDenied, AuthenticationRequired,
|
||||||
BackendTimeout, BackendNotAvailable, BackendError, NetworkError, UnknownError
|
BackendTimeout, BackendNotAvailable, BackendError, NetworkError, UnknownBackendResponse, UnknownError
|
||||||
)
|
)
|
||||||
|
|
||||||
class HttpClient:
|
class HttpClient:
|
||||||
@@ -25,10 +25,14 @@ class HttpClient:
|
|||||||
response = await self._session.request(method, *args, **kwargs)
|
response = await self._session.request(method, *args, **kwargs)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
raise BackendTimeout()
|
raise BackendTimeout()
|
||||||
except aiohttp.ClientConnectionError:
|
|
||||||
raise NetworkError()
|
|
||||||
except aiohttp.ServerDisconnectedError:
|
except aiohttp.ServerDisconnectedError:
|
||||||
raise BackendNotAvailable()
|
raise BackendNotAvailable()
|
||||||
|
except aiohttp.ClientConnectionError:
|
||||||
|
raise NetworkError()
|
||||||
|
except aiohttp.ContentTypeError:
|
||||||
|
raise UnknownBackendResponse()
|
||||||
|
except aiohttp.ClientError:
|
||||||
|
raise UnknownError()
|
||||||
if response.status == HTTPStatus.UNAUTHORIZED:
|
if response.status == HTTPStatus.UNAUTHORIZED:
|
||||||
raise AuthenticationRequired()
|
raise AuthenticationRequired()
|
||||||
if response.status == HTTPStatus.FORBIDDEN:
|
if response.status == HTTPStatus.FORBIDDEN:
|
||||||
|
|||||||
Reference in New Issue
Block a user