-
Notifications
You must be signed in to change notification settings - Fork 248
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
WIP: Pass std::source_location
into libpqxx functions.
#947
Open
jtv
wants to merge
18
commits into
start-8
Choose a base branch
from
source_location
base: start-8
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
jtv
changed the title
Pass
WIP: Pass Jan 30, 2025
std::source_location
into libpqxx functions.std::source_location
into libpqxx functions.
This is just one small portion of the work needed. I'm trying to ensure that every libpqxx function that may throw an exception has a `source_location` parameter, and that it passes this to any functions it calls that may throw. The end result would ideally be that any exception thrown by libpqxx would include the location of the original call into libpqxx. In practice unfortunately I'm not so sure that I can attain this ideal. Type parameter packs make it difficult.
Previous commit did the same for `array`.
Went through the `connection` header & source file to pass source locations. I'm sure I missed a few spots, and of course the change leaked into many other modules.
There's a lot of places where I could not do this yet because of templating. Frankly I feel like the whole `std::source_location` is waiting for a do-over. But it's hard to imagine how it should work... Maybe by having some way to retrieve the call site from _within_ the callee. That would eliminate the gruesome parameter-passing.
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.
I'm trying to add std::source_location parameters to every libpqxx function that may throw, and pass the value on whenever those functions call other libpqxx functions that may throw. The ideal end state would be one where every exception coming out of libpqxx would convey the location of the original call into libpqxx that ultimately triggered the exception.
In practice this ideal does not look fully attainable, because as far as I can see...