Skip to content

Commit

Permalink
Defensive programming: Catch case where 'error_description' is missin…
Browse files Browse the repository at this point in the history
…g in response.
  • Loading branch information
rburema committed Jul 18, 2024
1 parent c16096c commit 273f85c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cura/OAuth2/AuthorizationHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def parseTokenResponse(self, token_response: QNetworkReply, callback: Callable[[
return

if token_response.error() != QNetworkReply.NetworkError.NoError:
callback(AuthenticationResponse(success = False, err_message = token_data["error_description"]))
callback(AuthenticationResponse(success = False, err_message = token_data.get("error_description", "an unknown server error occurred")))
return

callback(AuthenticationResponse(success = True,
Expand Down

0 comments on commit 273f85c

Please sign in to comment.