fix: handle malformed Gitea collections (#99)
This commit is contained in:
1 parent
7d5d1181c0
commit
f4e2969fec
2 files changed
+28
No files matched your search
@@ -81,6 +81,11 @@ async def context() -> JSONResponse:
|
||||
raise ValueError("Gitea current-user response was not an object")
|
||||
if not all(field in user_data for field in ("id", "login")):
|
||||
raise ValueError("Gitea current-user response did not include id and login")
|
||||
if any(
|
||||
data is not None and not isinstance(data, list)
|
||||
for data in (repo_data, issues_data, prs_data)
|
||||
):
|
||||
raise ValueError("Gitea collection response was not a list")
|
||||
except Exception as e:
|
||||
error_message = (
|
||||
f"Gitea context request timed out after {CONTEXT_TIMEOUT_SECONDS:g}s"
|
||||
|
||||
Reference in new issue
Block a user