Skip to content

Commit

Permalink
Updated messages again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kraust committed May 27, 2024
1 parent 3e5cb6a commit 36d8a94
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions OSCRUI/leagueconnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ def download(self, id):
except OSCR_django_client.exceptions.ServiceException as e:
reply = QMessageBox()
reply.setWindowTitle("Open Source Combatlog Reader")
reply.setText(str(e))
try:
data = json.loads.body(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")
reply.exec()

return None
Expand All @@ -265,7 +269,11 @@ def ladders(self):
except OSCR_django_client.exceptions.ServiceException as e:
reply = QMessageBox()
reply.setWindowTitle("Open Source Combatlog Reader")
reply.setText(str(e))
try:
data = json.loads.body(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")
reply.exec()

return None
Expand All @@ -282,7 +290,11 @@ def ladder_entries(self, id, page=1):
except OSCR_django_client.exceptions.ServiceException as e:
reply = QMessageBox()
reply.setWindowTitle("Open Source Combatlog Reader")
reply.setText(str(e))
try:
data = json.loads.body(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")
reply.exec()

return None

0 comments on commit 36d8a94

Please sign in to comment.