Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SSLError to exceptions #7043

Merged
merged 1 commit into from
Sep 9, 2022
Merged

Add SSLError to exceptions #7043

merged 1 commit into from
Sep 9, 2022

Conversation

drew2a
Copy link
Contributor

@drew2a drew2a commented Sep 9, 2022

This PR fixes #7035

@drew2a drew2a marked this pull request as ready for review September 9, 2022 12:38
@drew2a drew2a requested review from a team and xoriole and removed request for a team September 9, 2022 12:38
@@ -101,7 +99,8 @@ async def get_torrent_info(self, request):
elif scheme in (HTTP_SCHEME, HTTPS_SCHEME):
try:
response = await query_http_uri(uri)
except (ServerConnectionError, ClientResponseError) as e:
except (ServerConnectionError, ClientResponseError, SSLError) as e:
self._logger.warning(f'Error while querying http uri: {e}')
return RESTResponse({"error": str(e)}, status=HTTP_INTERNAL_SERVER_ERROR)
Copy link
Contributor

@kozlovsky kozlovsky Sep 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Instead of 500 HTTP_INTERNAL_SERVER_ERROR, I'd use the "502 Bad Gateway" status here, as the error is not caused by some problem with the Tribler code. Also, the correct code on line 98 is probably "400 Bad Request". Ideally, code 500 should be for errors that should be fixed on the Tribler side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants