Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 8 additions & 3 deletions app/utils/communication/matrix.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any

import requests
import httpx

from app.types.exceptions import MatrixRequestError, MatrixSendMessageError

Expand Down Expand Up @@ -43,10 +43,15 @@ def post(
if "Authorization" not in headers:
headers["Authorization"] = "Bearer " + self.access_token

response = requests.post(url, json=json, headers=headers, timeout=10)
try:
response = httpx.post(
url,
json=json,
headers=headers,
timeout=10,
)
response.raise_for_status()
except requests.exceptions.HTTPError as err:
except httpx.RequestError as err:
raise MatrixRequestError() from err

return response.json()
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ types-Authlib==1.5.0.20250516
types-fpdf2==2.8.3.20250516
types-psutil==7.0.0.20250601
types-redis==4.6.0.20241004
types-requests==2.32.0.20250515
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ PyMuPDF==1.26.6 # PDF processing, imported as `fitz`
pypdf==6.4.0
python-multipart==0.0.18 # a form data parser, as oauth flow requires form-data parameters
redis==5.0.8
requests==2.32.4
sqlalchemy-utils == 0.41.2
SQLAlchemy[asyncio]==2.0.44 # [asyncio] allows greenlet to be installed on Apple M1 devices.
unidecode==1.3.8
Expand Down
Loading