Skip to content

Commit

Permalink
Updated error log reporting in league connector.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kraust committed May 27, 2024
1 parent 0b55b77 commit ba265c4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions OSCRUI/leagueconnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ def upload(self, filename):
lines.append(entry.detail)
reply.setText("\n".join(lines))
except OSCR_django_client.exceptions.ServiceException as e:
print(e.body)
try:
data = json.loads.body(e.body)
data = json.loads(e.body)
reply.setText(data.get("detail", "Failed to parse error from server"))
except Exception as e:
reply.setText("Failed to parse error from server")
Expand All @@ -254,7 +255,7 @@ def download(self, id):
reply = QMessageBox()
reply.setWindowTitle("Open Source Combatlog Reader")
try:
data = json.loads.body(e.body)
data = json.loads(e.body)
reply.setText(data.get("detail", "Failed to parse error from server"))
except Exception as e:
reply.setText("Failed to parse error from server")
Expand All @@ -270,7 +271,7 @@ def ladders(self):
reply = QMessageBox()
reply.setWindowTitle("Open Source Combatlog Reader")
try:
data = json.loads.body(e.body)
data = json.loads(e.body)
reply.setText(data.get("detail", "Failed to parse error from server"))
except Exception as e:
reply.setText("Failed to parse error from server")
Expand All @@ -291,7 +292,7 @@ def ladder_entries(self, id, page=1):
reply = QMessageBox()
reply.setWindowTitle("Open Source Combatlog Reader")
try:
data = json.loads.body(e.body)
data = json.loads(e.body)
reply.setText(data.get("detail", "Failed to parse error from server"))
except Exception as e:
reply.setText("Failed to parse error from server")
Expand Down

0 comments on commit ba265c4

Please sign in to comment.