Skip to content

Commit e2aa81f

Browse files
committed
handle errors in UpstreamHandler
Shouldn't have any downstream effects as this is not used anywhere.
1 parent 9b13aad commit e2aa81f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jupyterlab_git/handlers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,10 @@ async def post(self):
401401
"""
402402
current_path = self.get_json_body()["current_path"]
403403
current_branch = await self.git.get_current_branch(current_path)
404-
upstream = await self.git.get_upstream_branch(current_path, current_branch)
405-
self.finish(json.dumps({"upstream": upstream}))
404+
response = await self.git.get_upstream_branch(current_path, current_branch)
405+
if response['code'] != 0:
406+
self.set_status(500)
407+
self.finish(json.dumps(upstream))
406408

407409

408410
class GitPullHandler(GitHandler):

0 commit comments

Comments
 (0)