Conversation
pathunstrom
reviewed
Jan 3, 2024
Fix some typos and references and run a standard formatter on the code base to fix up indentation issues.
If you hit an error like a missing hostport, you end up getting two screenfulls or so of stack traces, which tells you almost nothing, on a "wrong SSL version" message, which tells you something incorrect. We handle some errors more directly. However, the deeper issue is that it's super annoying to both have to check for errors AND have to catch exceptions. We treat errors as exceptions now; if the server yields a non-200 status code, or we get an error message even on a 200, we raise the error as an exception. The "stoponerrors" feature is now the only real option, because it doesn't actually make *sense* to set it to "no" outside of test cases. This dramatically simplifies a lot of code. In the async case, we still raise a GroupException of any exceptions encountered, unless there's none in which case we yield results. Some tests are a bit stricter or more careful; for instance, if we do two queries, we can just assert that we get exactly two responses, not "two or more".
We started getting Ominous Warnings about directly specifying capath/cafile to connections, so we create an SSL Context now. As a result, we catch nonexistent cafile/capath during initial client config, because we create the context once at startup. Also, at the same time, move the URL computation to startup since it never changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is mostly refactoring error handling to make errors a bit cleaner, but we also fix up a deprecation warning in the SSL stuff and correct a couple of typos, etc.