Skip to content
Snippets Groups Projects
Commit 65e2d5ec authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch '34-catch-errors-of-the-bbb-servers' into 'master'

Resolve "Catch errors of the bbb servers"

Closes #34

See merge request !38
parents f0ef969f 4e132e88
No related branches found
No related tags found
1 merge request!38Resolve "Catch errors of the bbb servers"
Pipeline #3891 failed
......@@ -37,6 +37,11 @@ except ImportError: # pragma: no cover
logger = logging.getLogger(__name__)
class BigBlueButtonError(Exception):
"""Exception raised when a BigBlueButton backends encounters an error."""
pass
@dataclass
class BigBlueButton:
"""One BigBlueButton server.
......@@ -134,6 +139,9 @@ class BigBlueButton:
url = self._build_url(call, params)
res = self._session.get(url, timeout=self.request_timeout)
if res.status_code != 200:
raise BigBlueButtonError(f"Backend returned HTTP status {res.status_code}.")
xml = xmltodict.parse(res.text)
return xml["response"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment