Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066463
D4466.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D4466.id.diff
View Options
diff --git a/swh/graph/server/app.py b/swh/graph/server/app.py
--- a/swh/graph/server/app.py
+++ b/swh/graph/server/app.py
@@ -60,9 +60,9 @@
try:
return self.backend.swhid2node[swhid]
except KeyError:
- raise aiohttp.web.HTTPNotFound(body=f"SWHID not found: {swhid}")
+ raise aiohttp.web.HTTPNotFound(text=f"SWHID not found: {swhid}")
except ValidationError:
- raise aiohttp.web.HTTPBadRequest(body=f"malformed SWHID: {swhid}")
+ raise aiohttp.web.HTTPBadRequest(text=f"malformed SWHID: {swhid}")
def swhid_of_node(self, node):
"""Lookup a node in a node2swhid map, failing in an HTTP-nice way if
@@ -71,14 +71,14 @@
return self.backend.node2swhid[node]
except KeyError:
raise aiohttp.web.HTTPInternalServerError(
- body=f"reverse lookup failed for node id: {node}"
+ text=f"reverse lookup failed for node id: {node}"
)
def get_direction(self):
"""Validate HTTP query parameter `direction`"""
s = self.request.query.get("direction", "forward")
if s not in ("forward", "backward"):
- raise aiohttp.web.HTTPBadRequest(body=f"invalid direction: {s}")
+ raise aiohttp.web.HTTPBadRequest(text=f"invalid direction: {s}")
return s
def get_edges(self):
@@ -91,14 +91,14 @@
for node_type in edge.split(",", maxsplit=1)
]
):
- raise aiohttp.web.HTTPBadRequest(body=f"invalid edge restriction: {s}")
+ raise aiohttp.web.HTTPBadRequest(text=f"invalid edge restriction: {s}")
return s
def get_traversal(self):
"""Validate HTTP query parameter `traversal`, i.e., visit order"""
s = self.request.query.get("traversal", "dfs")
if s not in ("bfs", "dfs"):
- raise aiohttp.web.HTTPBadRequest(body=f"invalid traversal order: {s}")
+ raise aiohttp.web.HTTPBadRequest(text=f"invalid traversal order: {s}")
return s
def get_limit(self):
@@ -107,7 +107,7 @@
try:
return int(s)
except ValueError:
- raise aiohttp.web.HTTPBadRequest(body=f"invalid limit value: {s}")
+ raise aiohttp.web.HTTPBadRequest(text=f"invalid limit value: {s}")
class StreamingGraphView(GraphView):
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 10:32 AM (11 w, 16 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219724
Attached To
D4466: server/app: Fix aiohttp >= 3.7 exception related errors
Event Timeline
Log In to Comment