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

Use std::source_location in exceptions #468

Open
IAmNotHanni opened this issue Apr 28, 2022 · 1 comment · May be fixed by #473
Open

Use std::source_location in exceptions #468

IAmNotHanni opened this issue Apr 28, 2022 · 1 comment · May be fixed by #473
Assignees
Labels
cat:refactor refactor/clean up/simplifications/etc. prio:low This has low priority.

Comments

@IAmNotHanni
Copy link
Member

Is your feature request related to a problem?

When an InexorException is thrown, we don't store any information about the source location in it.

Description

We could use the new C++20 feature std::source_location to store information about the origin of the exception.

Alternatives

Do not use std::source_location at all

Affected Code

all of the code

Operating System

all operating systems

Additional Context

https://en.cppreference.com/w/cpp/utility/source_location

@IAmNotHanni IAmNotHanni added prio:low This has low priority. cat:refactor refactor/clean up/simplifications/etc. org:triage labels have to be specified or checked labels Apr 28, 2022
@IAmNotHanni
Copy link
Member Author

Ah nice: we can just offer std::source_location::current()) as a default argument and it will tell us in the exception message where the error occured in the code.

@IAmNotHanni IAmNotHanni self-assigned this Jun 18, 2022
@IAmNotHanni IAmNotHanni changed the title Can we use std::source_location in exceptions? Use std::source_location in exceptions Jun 19, 2022
@IAmNotHanni IAmNotHanni linked a pull request Jun 19, 2022 that will close this issue
@IAmNotHanni IAmNotHanni removed the org:triage labels have to be specified or checked label Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:refactor refactor/clean up/simplifications/etc. prio:low This has low priority.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant